diff --git a/extra/docker/clamp/docker-compose.yml b/extra/docker/clamp/docker-compose.yml
index 76992fd..69e4715 100644
--- a/extra/docker/clamp/docker-compose.yml
+++ b/extra/docker/clamp/docker-compose.yml
@@ -30,4 +30,4 @@
       - "../../../src/test/resources/http-cache/:/script/:ro"
     ports:
       - "8085:8085"
-    command: /bin/sh -c "pip install requests &&  pip install simplejson && python -u /script/third_party_proxy.py -v true --port 8085 --root /thirdparty"
+    command: /bin/sh -c "pip install requests &&  pip install simplejson && python -u /script/third_party_proxy.py -v true --port 8085 --root /thirdparty --proxyaddress third_party_proxy:8085"
diff --git a/src/main/resources/clds/templates/ui-alarm-default.json b/src/main/resources/clds/templates/ui-alarm-default.json
index 0d08359..c851e6c 100644
--- a/src/main/resources/clds/templates/ui-alarm-default.json
+++ b/src/main/resources/clds/templates/ui-alarm-default.json
@@ -267,7 +267,7 @@
 	"jnxSpaceSNAProcessUp": "vDBE-EMS-Juniper: jnxSpaceSNAProcessUp",
 	"jnxSpaceNodeDown": "vDBE-EMS-Juniper: jnxSpaceNodeDown",
 	"jnxSpaceNodeUp": "vDBE-EMS-Juniper: jnxSpaceNodeUp",
-	" jnxSpaceNodeRemoval": "vDBE-EMS-Juniper:  jnxSpaceNodeRemoval",
+	"jnxSpaceNodeRemoval": "vDBE-EMS-Juniper:  jnxSpaceNodeRemoval",
 	"jnxCmCfgChange": "vDBE-Juniper: jnxCmCfgChange",
 	"jnxCmRescueChange": "vDBE-Juniper: jnxCmRescueChange",
 	"jnxEventTrap": "vDBE-Juniper: jnxEventTrap",
diff --git a/src/test/resources/clds/templates/ui-alarm-default.json b/src/test/resources/clds/templates/ui-alarm-default.json
index 0d08359..c851e6c 100644
--- a/src/test/resources/clds/templates/ui-alarm-default.json
+++ b/src/test/resources/clds/templates/ui-alarm-default.json
@@ -267,7 +267,7 @@
 	"jnxSpaceSNAProcessUp": "vDBE-EMS-Juniper: jnxSpaceSNAProcessUp",
 	"jnxSpaceNodeDown": "vDBE-EMS-Juniper: jnxSpaceNodeDown",
 	"jnxSpaceNodeUp": "vDBE-EMS-Juniper: jnxSpaceNodeUp",
-	" jnxSpaceNodeRemoval": "vDBE-EMS-Juniper:  jnxSpaceNodeRemoval",
+	"jnxSpaceNodeRemoval": "vDBE-EMS-Juniper:  jnxSpaceNodeRemoval",
 	"jnxCmCfgChange": "vDBE-Juniper: jnxCmCfgChange",
 	"jnxCmRescueChange": "vDBE-Juniper: jnxCmRescueChange",
 	"jnxEventTrap": "vDBE-Juniper: jnxEventTrap",
diff --git a/src/test/resources/http-cache/example/pdp/api/deletePolicy/.file b/src/test/resources/http-cache/example/pdp/api/deletePolicy/.file
new file mode 100644
index 0000000..0637a08
--- /dev/null
+++ b/src/test/resources/http-cache/example/pdp/api/deletePolicy/.file
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/src/test/resources/http-cache/example/pdp/api/deletePolicy/.header b/src/test/resources/http-cache/example/pdp/api/deletePolicy/.header
new file mode 100644
index 0000000..6a280d9
--- /dev/null
+++ b/src/test/resources/http-cache/example/pdp/api/deletePolicy/.header
@@ -0,0 +1 @@
+{"Transfer-Encoding": "chunked", "Set-Cookie": "JSESSIONID=158qxkdtdobkd1umr3ikkgrmlx;Path=/", "Expires": "Thu, 01 Jan 1970 00:00:00 GMT", "Server": "Jetty(9.3.21.v20170918)", "Content-Type": "application/json", "X-ECOMP-RequestID": "e2ddb3c8-994f-47df-b4dc-097d4fb55c08"}
\ No newline at end of file
diff --git a/src/test/resources/http-cache/start_http_cache.sh b/src/test/resources/http-cache/start_http_cache.sh
index fe9e991..47c3cc8 100755
--- a/src/test/resources/http-cache/start_http_cache.sh
+++ b/src/test/resources/http-cache/start_http_cache.sh
@@ -34,4 +34,4 @@
 echo 'Installing requests packages for Python'
 pip install requests
 echo 'Executing the Http proxy in Cache mode only'
-python third_party_proxy.py --port 8080 --root /usr/src/http-cache-app/data-cache
+python third_party_proxy.py --port 8080 --root /usr/src/http-cache-app/data-cache --proxyaddress localhost:8085
diff --git a/src/test/resources/http-cache/third_party_proxy.py b/src/test/resources/http-cache/third_party_proxy.py
index 72ea495..29d34cc 100755
--- a/src/test/resources/http-cache/third_party_proxy.py
+++ b/src/test/resources/http-cache/third_party_proxy.py
@@ -41,6 +41,7 @@
 parser.add_argument("--proxy"         , type=str, help="Url of the  Act as a proxy. If not set, this script only uses the cache and will return a 404 if files aren't found")
 parser.add_argument("--port",     "-P", type=int, default="8081", help="Port on which the proxy should listen to")
 parser.add_argument("--verbose",  "-v", type=bool, help="Print more information in case of error")
+parser.add_argument("--proxyaddress","-a", type=str, help="Address of this proxy, generally either third_party_proxy:8085 or localhost:8085 depending if started with docker-compose or not")
 options = parser.parse_args()
 
 
@@ -49,6 +50,7 @@
 AUTH = (options.username, options.password)
 HEADERS = {'X-ECOMP-InstanceID':'CLAMP'}
 CACHE_ROOT = options.root
+PROXY_ADDRESS=options.proxyaddress
 
 def signal_handler(signal_sent, frame):
     global httpd
@@ -116,7 +118,17 @@
 
                 os.makedirs(cached_file, True)
                 with open(cached_file_header, 'w') as f:
-                    f.write("{\"Content-Length\": \"144\", \"Content-Type\": \"application/json\"}")
+                    f.write("{\"Content-Length\": \"" + str(len(jsonGenerated)) + "\", \"Content-Type\": \"application/json\"}")
+                with open(cached_file_content, 'w') as f:
+                    f.write(jsonGenerated)
+            elif self.path.startswith("/dcae-operationstatus"):
+                print "self.path start with /dcae-operationstatus, generating response json..."
+                jsonGenerated =  "{\"operationType\": \"operationType1\", \"status\": \"succeeded\"}"
+                print "jsonGenerated: " + jsonGenerated
+
+                os.makedirs(cached_file, True)
+                with open(cached_file_header, 'w') as f:
+                    f.write("{\"Content-Length\": \"" + str(len(jsonGenerated)) + "\", \"Content-Type\": \"application/json\"}")
                 with open(cached_file_content, 'w') as f:
                     f.write(jsonGenerated)
             else:
@@ -215,27 +227,91 @@
         cached_file_header = "%s/.header" % (cached_file,)
 
         _file_available = os.path.exists(cached_file_content)
-        if not _file_available and not HOST:
-            print("No file corresponding in cache and no HOST specified: %s" % HOST)
-            self.send_response(404)
-            return "404 Not found"
 
         if not _file_available:
-            print("Request for data currently not present in cache: %s" % (cached_file,))
+            if self.path.startswith("/dcae-deployments/"):
+                print "self.path start with /dcae-deployments/, generating response json..."
+                #jsondata = json.loads(self.data_string)
+                jsonGenerated = "{\"links\":{\"status\":\"http:\/\/" + PROXY_ADDRESS + "\/dcae-operationstatus\",\"test2\":\"test2\"}}"
+                print "jsonGenerated: " + jsonGenerated
 
-            url = '%s%s' % (HOST, self.path)
-            print("url: %s" % (url,))
-            response = requests.put(url, data=self.data_string, headers=self.headers, stream=True)
-
-            if response.status_code == 200:
-                self._write_cache(cached_file, cached_file_header, cached_file_content, response)
+                os.makedirs(cached_file, True)
+                with open(cached_file_header, 'w') as f:
+                    f.write("{\"Content-Length\": \"" + str(len(jsonGenerated)) + "\", \"Content-Type\": \"application/json\"}")
+                with open(cached_file_content, 'w') as f:
+                    f.write(jsonGenerated)
             else:
-                print('Error when requesting file :')
-                print('Requested url : %s' % (url,))
-                print('Status code : %s' % (response.status_code,))
-                print('Content : %s' % (response.content,))
-                self.send_response(response.status_code)
-                return response.content
+                if not HOST:
+                    self.send_response(404)
+                    return "404 Not found"
+
+                print("Request for data currently not present in cache: %s" % (cached_file,))
+
+                url = '%s%s' % (HOST, self.path)
+                print("url: %s" % (url,))
+                response = requests.put(url, data=self.data_string, headers=self.headers, stream=True)
+
+                if response.status_code == 200:
+                    self._write_cache(cached_file, cached_file_header, cached_file_content, response)
+                else:
+                    print('Error when requesting file :')
+                    print('Requested url : %s' % (url,))
+                    print('Status code : %s' % (response.status_code,))
+                    print('Content : %s' % (response.content,))
+                    self.send_response(response.status_code)
+                    return response.content
+        else:
+            print("Request for data present in cache: %s" % (cached_file,))
+
+        self._send_content(cached_file_header, cached_file_content)
+
+
+    def do_DELETE(self):
+        print("\n\n\nGot a DELETE for %s " % self.path)
+        self.check_credentials()
+        print("self.headers:\n %s" % self.headers)
+
+        cached_file = '%s/%s' % (CACHE_ROOT, self.path,)
+        print("Cached file name before escaping : %s" % cached_file)
+        cached_file = cached_file.replace('<','&#60;').replace('>','&#62;').replace('?','&#63;').replace('*','&#42;').replace('\\','&#42;').replace(':','&#58;').replace('|','&#124;')
+        print("Cached file name after escaping (used for cache storage) : %s" % cached_file)
+        cached_file_content = "%s/.file" % (cached_file,)
+        cached_file_header = "%s/.header" % (cached_file,)
+
+        _file_available = os.path.exists(cached_file_content)
+
+        if not _file_available:
+            if self.path.startswith("/dcae-deployments/"):
+                print "self.path start with /dcae-deployments/, generating response json..."
+                #jsondata = json.loads(self.data_string)
+                jsonGenerated = "{\"links\":{\"status\":\"http:\/\/" + PROXY_ADDRESS + "\/dcae-operationstatus\",\"test2\":\"test2\"}}"
+                print "jsonGenerated: " + jsonGenerated
+
+                os.makedirs(cached_file, True)
+                with open(cached_file_header, 'w') as f:
+                    f.write("{\"Content-Length\": \"" + str(len(jsonGenerated)) + "\", \"Content-Type\": \"application/json\"}")
+                with open(cached_file_content, 'w') as f:
+                    f.write(jsonGenerated)
+            else:
+                if not HOST:
+                    self.send_response(404)
+                    return "404 Not found"
+
+                print("Request for data currently not present in cache: %s" % (cached_file,))
+
+                url = '%s%s' % (HOST, self.path)
+                print("url: %s" % (url,))
+                response = requests.put(url, data=self.data_string, headers=self.headers, stream=True)
+
+                if response.status_code == 200:
+                    self._write_cache(cached_file, cached_file_header, cached_file_content, response)
+                else:
+                    print('Error when requesting file :')
+                    print('Requested url : %s' % (url,))
+                    print('Status code : %s' % (response.status_code,))
+                    print('Content : %s' % (response.content,))
+                    self.send_response(response.status_code)
+                    return response.content
         else:
             print("Request for data present in cache: %s" % (cached_file,))
 
