diff --git a/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py b/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py
index baa8165..010c523 100644
--- a/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py
+++ b/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py
@@ -4,6 +4,7 @@
 import re
 import time
 from http.server import BaseHTTPRequestHandler
+from os.path import basename
 import httpServerLib
 
 ch = logging.StreamHandler(sys.stdout)
@@ -16,72 +17,125 @@
 
 logger = logging.getLogger('AAI-simulator-logger')
 
-pnf_name = 'Empty'
-pnf_entry = {}
+AAI_RESOURCE_NOT_FOUND = b'{}'
 
-
-def _mark_response_as_http_ok(http_endpoint):
-    logger.info('Execution status 200')
-    httpServerLib.header_200_and_json(http_endpoint)
-
+pnf_entries = {}
+patched_pnf = AAI_RESOURCE_NOT_FOUND
+created_logical_link = AAI_RESOURCE_NOT_FOUND
 
 class AAISetup(BaseHTTPRequestHandler):
 
+    def do_GET(self):
+        try:
+            if re.search('/setup/patched_pnf', self.path):
+                httpServerLib.set_response_200_ok(self, payload = patched_pnf)
+                logger.debug('AAISetup GET /setup/patched_pnf -> 200 OK')
+            elif re.search('/setup/created_logical_link', self.path):
+                httpServerLib.set_response_200_ok(self, payload = created_logical_link)
+                logger.debug('AAISetup GET /setup/created_logical_link -> 200 OK')
+            else:
+                httpServerLib.set_response_404_not_found(self)
+                logger.info('AAISetup GET ' + self.path + ' -> 404 Not found')
+        except Exception as e:
+            logger.error(e)
+            httpServerLib.set_response_500_server_error(self)
+
     def do_PUT(self):
-        logger.info('AAI SIM Setup Put execution')
-        if re.search('/set_pnf$', self.path): # to avoid regex collisions '$' must be added
-            global pnf_name
-            content_length = self._get_content_length()
-            pnf_name = self.rfile.read(content_length).decode()
-            _mark_response_as_http_ok(self)
+        try:
+            if re.search('/setup/add_pnf_entry', self.path):
+                pnf_entry = httpServerLib.get_payload(self)
+                pnf_name = json.loads(pnf_entry).get("pnf-name")
+                if pnf_name == None:
+                    raise Exception("Invalid PNF entry, could not extract `pnf-name`")
 
-        if re.search('/set_pnf_entry',self.path):
-            global pnf_entry
-            content_length = self._get_content_length()
-            pnf_entry = json.loads(self.rfile.read(content_length))
-            _mark_response_as_http_ok(self)
+                global pnf_entries
+                pnf_entries[pnf_name] = pnf_entry
 
-        return
+                httpServerLib.set_response_200_ok(self)
+                logger.debug('AAISetup PUT /setup/add_pnf_entry [' + pnf_name + '] -> 200 OK')
+            elif re.search('/set_pnf', self.path):
+                pnf_name = httpServerLib.get_payload(self).decode()
+                pnf_entries[pnf_name] = AAI_RESOURCE_NOT_FOUND
+                httpServerLib.set_response_200_ok(self)
+            else:
+                httpServerLib.set_response_404_not_found(self)
+                logger.info('AAISetup PUT ' + self.path + ' -> 404 Not found')
+        except Exception as e:
+            logger.error(e)
+            httpServerLib.set_response_500_server_error(self)
 
     def do_POST(self):
-        logger.info('AAI SIM Setup Post execution')
-        if re.search('/reset', self.path):
-            global pnf_name
-            pnf_name = 'Empty'
-            _mark_response_as_http_ok(self)
+        try:
+            if re.search('/reset', self.path):
+                global pnf_entries
+                global patched_pnf
+                global created_logical_link
+                pnf_entries = {}
+                patched_pnf = AAI_RESOURCE_NOT_FOUND
+                created_logical_link = AAI_RESOURCE_NOT_FOUND
 
-        return
-
-    def _get_content_length(self):
-        return int(self.headers['Content-Length'])
-
+                httpServerLib.set_response_200_ok(self)
+                logger.debug('AAISetup POST /reset -> 200 OK')
+            else:
+                httpServerLib.set_response_404_not_found(self)
+                logger.info('AAISetup POST ' + self.path + ' -> 404 Not found')
+        except Exception as e:
+            logger.error(e)
+            httpServerLib.set_response_500_server_error(self)
 
 class AAIHandler(BaseHTTPRequestHandler):
 
     def do_GET(self):
-        logger.info('AAI SIM Get execution')
-        full_request_path = '/aai/v12/network/pnfs/pnf/' + pnf_name
-        if re.search(full_request_path, self.path):
-            _mark_response_as_http_ok(self)
-            body = json.dumps(pnf_entry)
-            logger.info('AAI SIM Get json prepared')
-            self.wfile.write(body.encode())
-        return
-
+        try:
+            if re.search('/aai/v12/network/pnfs/pnf/[^/]*$', self.path):
+                pnf_name = basename(self.path)
+                if pnf_name in pnf_entries:
+                    httpServerLib.set_response_200_ok(self, payload = pnf_entries[pnf_name])
+                    logger.debug('AAIHandler GET /aai/v12/network/pnfs/pnf/' + pnf_name + ' -> 200 OK')
+                else:
+                    httpServerLib.set_response_404_not_found(self)
+                    logger.info('AAIHandler GET /aai/v12/network/pnfs/pnf/' + pnf_name + ' -> 404 Not found, actual entries: ' + str(pnf_entries.keys()))
+            else:
+                httpServerLib.set_response_404_not_found(self)
+                logger.info('AAIHandler GET ' + self.path + ' -> 404 Not found')
+        except Exception as e:
+            logger.error(e)
+            httpServerLib.set_response_500_server_error(self)
 
     def do_PATCH(self):
-        logger.info('AAI SIM Patch execution')
-        pnfs_name = '/aai/v12/network/pnfs/pnf/' + pnf_name
-        if re.search('wrong_aai_record', self.path):
-            self.send_response(400)
-            logger.info('Execution status 400')
-            self.end_headers()
-        elif re.search(pnfs_name, self.path):
-            self.send_response(200)
-            logger.info('Execution status 200')
-            self.end_headers()
-            
-        return
+        try:
+            if re.search('/aai/v12/network/pnfs/pnf/[^/]*$', self.path):
+                pnf_name = basename(self.path)
+                if pnf_name in pnf_entries:
+                    global patched_pnf
+                    patched_pnf = httpServerLib.get_payload(self)
+
+                    httpServerLib.set_response_200_ok(self)
+                    logger.debug('AAIHandler PATCH /aai/v12/network/pnfs/pnf/' + pnf_name + ' -> 200 OK')
+                else:
+                    httpServerLib.set_response_404_not_found(self)
+                    logger.info('AAIHandler PATCH /aai/v12/network/pnfs/pnf/' + pnf_name + ' -> 404 Not found, actual entries: ' + str(pnf_entries.keys()))
+            else:
+                httpServerLib.set_response_404_not_found(self)
+                logger.info('AAIHandler PATCH ' + self.path + ' -> 404 Not found')
+        except Exception as e:
+            logger.error(e)
+            httpServerLib.set_response_500_server_error(self)
+
+    def do_PUT(self):
+        try:
+            if re.search('/aai/v12/network/logical-links/logical-link/[^/]*$', self.path):
+                global created_logical_link
+                created_logical_link = httpServerLib.get_payload(self)
+
+                httpServerLib.set_response_200_ok(self)
+                logger.debug('AAIHandler PUT /aai/v12/network/logical-links/logical-link/' + created_logical_link + ' -> 200 OK')
+            else:
+                httpServerLib.set_response_404_not_found(self)
+                logger.info('AAIHandler PUT ' + self.path + ' -> 404 Not found')
+        except Exception as e:
+            logger.error(e)
+            httpServerLib.set_response_500_server_error(self)
 
 
 def _main_(handler_class=AAIHandler, protocol="HTTP/1.0"):
diff --git a/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py b/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py
index da113e6..7f590a5 100644
--- a/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py
+++ b/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py
@@ -15,62 +15,85 @@
 
 logger = logging.getLogger('DMaaP-simulator-logger')
 
-posted_event_from_prh = b'Empty'
-received_event_to_get_method = b'Empty'
+DMAAP_EMPTY = b'[]'
 
+ves_event = DMAAP_EMPTY
+captured_prh_event = DMAAP_EMPTY
 
 class DmaapSetup(BaseHTTPRequestHandler):
 
-    def do_PUT(self):
-        logger.info('DMaaP SIM Setup Put execution')
-        if re.search('/set_get_event', self.path):
-            global received_event_to_get_method
-            content_length = int(self.headers['Content-Length'])
-            received_event_to_get_method = self.rfile.read(content_length)
-            httpServerLib.header_200_and_json(self)
-
-        return
-
     def do_GET(self):
-        logger.info('DMaaP SIM Setup Get execution')
-        if re.search('/events/pnfReady', self.path):
-            httpServerLib.header_200_and_json(self)
-            self.wfile.write(posted_event_from_prh)
+        try:
+            if re.search('/setup/pnf_ready', self.path) or re.search('events/pnfReady', self.path):
+                global captured_prh_event
+                httpServerLib.set_response_200_ok(self, payload = captured_prh_event)
+                logger.debug('DmaapSetup GET /setup/pnf_ready -> 200 OK')
+            else:
+                httpServerLib.set_response_404_not_found(self)
+                logger.info('DmaapSetup GET ' + self.path + ' -> 404 Not found')
+        except Exception as e:
+            logger.error(e)
+            httpServerLib.set_response_500_server_error(self)
 
-        return
+    def do_PUT(self):
+        try:
+            if re.search('/setup/ves_event', self.path) or re.search('/set_get_event', self.path):
+                global ves_event
+                ves_event = httpServerLib.get_payload(self)
+                httpServerLib.set_response_200_ok(self)
+                logger.debug('DmaapSetup PUT /setup/ves_event -> 200 OK')
+            else:
+                httpServerLib.set_response_404_not_found(self)
+                logger.info('DmaapSetup PUT ' + self.path + ' -> 404 Not found')
+        except Exception as e:
+            logger.error(e)
+            httpServerLib.set_response_500_server_error(self)
 
     def do_POST(self):
-        logger.info('DMaaP SIM Setup Post execution')
-        if re.search('/reset', self.path):
-            global posted_event_from_prh
-            global received_event_to_get_method
-            posted_event_from_prh = b'Empty'
-            received_event_to_get_method = b'Empty'
-            httpServerLib.header_200_and_json(self)
-
-        return
-
+        try:
+            if re.search('/reset', self.path):
+                global ves_event
+                global captured_prh_event
+                ves_event = DMAAP_EMPTY
+                captured_prh_event = DMAAP_EMPTY
+                httpServerLib.set_response_200_ok(self)
+                logger.debug('DmaapSetup POST /reset -> 200 OK')
+            else:
+                httpServerLib.set_response_404_not_found(self)
+                logger.info('DmaapSetup POST ' + self.path + ' -> 404 Not found')
+        except Exception as e:
+            logger.error(e)
+            httpServerLib.set_response_500_server_error(self)
 
 class DMaaPHandler(BaseHTTPRequestHandler):
 
     def do_POST(self):
-        logger.info('DMaaP SIM Post execution')
-        if re.search('/events/unauthenticated.PNF_READY', self.path):
-            global posted_event_from_prh
-            content_length = int(self.headers['Content-Length'])
-            posted_event_from_prh = self.rfile.read(content_length)
-            httpServerLib.header_200_and_json(self)
-
-        return
+        try:
+            if re.search('/events/unauthenticated.PNF_READY', self.path):
+                global captured_prh_event
+                captured_prh_event = httpServerLib.get_payload(self)
+                httpServerLib.set_response_200_ok(self)
+                logger.debug('DMaaPHandler POST /events/unauthenticated.PNF_READY -> 200')
+            else:
+                httpServerLib.set_response_404_not_found(self)
+                logger.info('DMaaPHandler POST ' + self.path + ' -> 404 Not found')
+        except Exception as e:
+            logger.error(e)
+            httpServerLib.set_response_500_server_error(self)
 
     def do_GET(self):
-        logger.info('DMaaP SIM Get execution')
-        if re.search('/events/unauthenticated.VES_PNFREG_OUTPUT/OpenDcae-c12/c12', self.path):
-            httpServerLib.header_200_and_json(self)
-            self.wfile.write(received_event_to_get_method)
-
-        return
-
+        try:
+            if re.search('/events/unauthenticated.VES_PNFREG_OUTPUT/OpenDcae-c12/c12', self.path):
+                global ves_event
+                httpServerLib.set_response_200_ok(self, payload = ves_event)
+                ves_event = DMAAP_EMPTY
+                logger.debug('DMaaPHandler GET /events/unauthenticated.VES_PNFREG_OUTPUT/OpenDcae-c12/c12 -> 200')
+            else:
+                httpServerLib.set_response_404_not_found(self)
+                logger.info('DMaaPHandler GET ' + self.path + ' -> 404 Not found')
+        except Exception as e:
+            logger.error(e)
+            httpServerLib.set_response_500_server_error(self)
 
 def _main_(handler_class=DMaaPHandler, protocol="HTTP/1.0"):
     handler_class.protocol_version = protocol
@@ -80,6 +103,5 @@
     while 1:
         time.sleep(10)
 
-
 if __name__ == '__main__':
-    _main_()
+    _main_()
\ No newline at end of file
diff --git a/tests/dcaegen2/prh-testcases/resources/simulator/httpServerLib.py b/tests/dcaegen2/prh-testcases/resources/simulator/httpServerLib.py
index 7b54539..e91927e 100644
--- a/tests/dcaegen2/prh-testcases/resources/simulator/httpServerLib.py
+++ b/tests/dcaegen2/prh-testcases/resources/simulator/httpServerLib.py
@@ -2,32 +2,44 @@
 import ssl
 from http.server import HTTPServer
 
-
-def header_200_and_json(self):
+def set_response_200_ok(self, payload = None):
     self.send_response(200)
     self.send_header('Content-Type', 'application/json')
     self.end_headers()
+    if payload != None:
+        self.wfile.write(payload)
 
+def set_response_404_not_found(self):
+    self.send_response(404)
+    self.end_headers()
+
+def set_response_500_server_error(self):
+    self.send_response(500)
+    self.end_headers()
+
+def get_payload(self):
+    if self.headers['Content-Length'] == None:
+        raise Exception('Invalid payload, Content-Length not defined')
+
+    content_length = int(self.headers['Content-Length'])
+    return self.rfile.read(content_length)
 
 def start_http_endpoint(port, handler_class):
     _thread.start_new_thread(init_http_endpoints, (port, handler_class))
 
-
 def start_https_endpoint(port, handler_class, keyfile, certfile, ca_certs):
     _thread.start_new_thread(init_https_endpoints, (port, handler_class, keyfile, certfile, ca_certs))
 
-
 def init_http_endpoints(port, handler_class, server_class=HTTPServer):
     server = server_class(('', port), handler_class)
     sa = server.socket.getsockname()
     print("Serving HTTP on", sa[0], "port", sa[1], "for", handler_class, "...")
     server.serve_forever()
 
-
 def init_https_endpoints(port, handler_class, keyfile, certfile, ca_certs, server_class=HTTPServer):
     server = server_class(('', port), handler_class)
     server.socket = ssl.wrap_socket(server.socket, keyfile=keyfile, certfile=certfile,
                                     ca_certs=ca_certs, server_side=True)
     sa = server.socket.getsockname()
     print("Serving HTTPS on", sa[0], "port", sa[1], "for", handler_class, "...")
-    server.serve_forever()
+    server.serve_forever()
\ No newline at end of file
