diff --git a/designate_tempest_plugin/tests/api/v2/test_blacklists.py b/designate_tempest_plugin/tests/api/v2/test_blacklists.py
index 271c65d..fc91471 100644
--- a/designate_tempest_plugin/tests/api/v2/test_blacklists.py
+++ b/designate_tempest_plugin/tests/api/v2/test_blacklists.py
@@ -108,3 +108,84 @@
         LOG.info('Ensure we response with updated values')
         self.assertEqual(pattern, body['pattern'])
         self.assertEqual(description, body['description'])
+
+
+class TestBlacklistNotFoundAdmin(BaseBlacklistsTest):
+
+    credentials = ["admin"]
+
+    @classmethod
+    def setup_clients(cls):
+        super(TestBlacklistNotFoundAdmin, cls).setup_clients()
+        cls.admin_client = cls.os_adm.blacklists_client
+
+    @test.attr(type='smoke')
+    @decorators.idempotent_id('9d65b638-fe98-47a8-853f-fa9244d144cc')
+    def test_show_blacklist_404(self):
+        e = self.assertRaises(lib_exc.NotFound,
+                              self.admin_client.show_blacklist,
+                              data_utils.rand_uuid())
+        self.assertBlacklist404(e.resp, e.resp_body)
+
+    @test.attr(type='smoke')
+    @decorators.idempotent_id('a9e12415-5040-4fba-905c-95d201fcfd3b')
+    def test_update_blacklist_404(self):
+        e = self.assertRaises(lib_exc.NotFound,
+                              self.admin_client.update_blacklist,
+                              data_utils.rand_uuid())
+        self.assertBlacklist404(e.resp, e.resp_body)
+
+    @test.attr(type='smoke')
+    @decorators.idempotent_id('b1132586-bf06-47a6-9f6f-3bab6a2c1932')
+    def test_delete_blacklist_404(self):
+        e = self.assertRaises(lib_exc.NotFound,
+                              self.admin_client.delete_blacklist,
+                              data_utils.rand_uuid())
+        self.assertBlacklist404(e.resp, e.resp_body)
+
+    def assertBlacklist404(self, resp, resp_body):
+        self.assertEqual(404, resp.status)
+        self.assertEqual(404, resp_body['code'])
+        self.assertEqual("blacklist_not_found", resp_body['type'])
+        self.assertEqual("Could not find Blacklist", resp_body['message'])
+
+
+class TestBlacklistInvalidIdAdmin(BaseBlacklistsTest):
+
+    credentials = ["admin"]
+
+    @classmethod
+    def setup_clients(cls):
+        super(TestBlacklistInvalidIdAdmin, cls).setup_clients()
+        cls.admin_client = cls.os_adm.blacklists_client
+
+    @test.attr(type='smoke')
+    @decorators.idempotent_id('c7bae53f-2edc-45d8-b254-8a81482728c1')
+    def test_show_blacklist_invalid_uuid(self):
+        e = self.assertRaises(lib_exc.BadRequest,
+                              self.admin_client.show_blacklist,
+                              'foo')
+        self.assertBlacklistInvalidId(e.resp, e.resp_body)
+
+    @test.attr(type='smoke')
+    @decorators.idempotent_id('c57b97da-ca87-44b5-9f40-a099937433bf')
+    def test_update_blacklist_invalid_uuid(self):
+        e = self.assertRaises(lib_exc.BadRequest,
+                              self.admin_client.update_blacklist,
+                              'foo')
+        self.assertBlacklistInvalidId(e.resp, e.resp_body)
+
+    @test.attr(type='smoke')
+    @decorators.idempotent_id('5d62a026-13e4-48b9-9773-1780660c5920')
+    def test_delete_blacklist_invalid_uuid(self):
+        e = self.assertRaises(lib_exc.BadRequest,
+                              self.admin_client.delete_blacklist,
+                              'foo')
+        self.assertBlacklistInvalidId(e.resp, e.resp_body)
+
+    def assertBlacklistInvalidId(self, resp, resp_body):
+        self.assertEqual(400, resp.status)
+        self.assertEqual(400, resp_body['code'])
+        self.assertEqual("invalid_uuid", resp_body['type'])
+        self.assertEqual("Invalid UUID blacklist_id: foo",
+                         resp_body['message'])
diff --git a/designate_tempest_plugin/tests/api/v2/test_pool.py b/designate_tempest_plugin/tests/api/v2/test_pool.py
index 8411f6e..5746ce0 100644
--- a/designate_tempest_plugin/tests/api/v2/test_pool.py
+++ b/designate_tempest_plugin/tests/api/v2/test_pool.py
@@ -18,6 +18,7 @@
 from tempest import test
 from tempest.lib import decorators
 from tempest.lib import exceptions as lib_exc
+from tempest.lib.common.utils import data_utils
 
 from designate_tempest_plugin.tests import base
 
@@ -121,3 +122,84 @@
 
         self.assertRaises(lib_exc.NotFound,
             lambda: self.admin_client.get(uri))
+
+
+class TestPoolNotFoundAdmin(BasePoolTest):
+
+    credentials = ["admin"]
+
+    @classmethod
+    def setup_clients(cls):
+        super(TestPoolNotFoundAdmin, cls).setup_clients()
+        cls.admin_client = cls.os_adm.pool_client
+
+    @test.attr(type='smoke')
+    @decorators.idempotent_id('56281b2f-dd5a-4376-8c32-aba771062fa5')
+    def test_show_pool_404(self):
+        e = self.assertRaises(lib_exc.NotFound,
+                              self.admin_client.show_pool,
+                              data_utils.rand_uuid())
+        self.assertPool404(e.resp, e.resp_body)
+
+    @test.attr(type='smoke')
+    @decorators.idempotent_id('10fba3c2-9972-479c-ace1-8f7eac7c159f')
+    def test_update_pool_404(self):
+        e = self.assertRaises(lib_exc.NotFound,
+                              self.admin_client.update_pool,
+                              data_utils.rand_uuid())
+        self.assertPool404(e.resp, e.resp_body)
+
+    @test.attr(type='smoke')
+    @decorators.idempotent_id('96132295-896b-4de3-8f86-cc2ee513fdad')
+    def test_delete_pool_404(self):
+        e = self.assertRaises(lib_exc.NotFound,
+                              self.admin_client.delete_pool,
+                              data_utils.rand_uuid())
+        self.assertPool404(e.resp, e.resp_body)
+
+    def assertPool404(self, resp, resp_body):
+        self.assertEqual(404, resp.status)
+        self.assertEqual(404, resp_body['code'])
+        self.assertEqual("pool_not_found", resp_body['type'])
+        self.assertEqual("Could not find Pool", resp_body['message'])
+
+
+class TestPoolInvalidIdAdmin(BasePoolTest):
+
+    credentials = ["admin"]
+
+    @classmethod
+    def setup_clients(cls):
+        super(TestPoolInvalidIdAdmin, cls).setup_clients()
+        cls.admin_client = cls.os_adm.pool_client
+
+    @test.attr(type='smoke')
+    @decorators.idempotent_id('081d0188-42a7-4953-af0e-b022960715e2')
+    def test_show_pool_invalid_uuid(self):
+        e = self.assertRaises(lib_exc.BadRequest,
+                              self.admin_client.show_pool,
+                              'foo')
+        self.assertPoolInvalidId(e.resp, e.resp_body)
+
+    @test.attr(type='smoke')
+    @decorators.idempotent_id('f4ab4f5a-d7f0-4758-b232-8338f02d7c5c')
+    def test_update_pool_invalid_uuid(self):
+        e = self.assertRaises(lib_exc.BadRequest,
+                              self.admin_client.update_pool,
+                              'foo')
+        self.assertPoolInvalidId(e.resp, e.resp_body)
+
+    @test.attr(type='smoke')
+    @decorators.idempotent_id('bf5ad3be-2e79-439d-b247-902fe198143b')
+    def test_delete_pool_invalid_uuid(self):
+        e = self.assertRaises(lib_exc.BadRequest,
+                              self.admin_client.delete_pool,
+                              'foo')
+        self.assertPoolInvalidId(e.resp, e.resp_body)
+
+    def assertPoolInvalidId(self, resp, resp_body):
+        self.assertEqual(400, resp.status)
+        self.assertEqual(400, resp_body['code'])
+        self.assertEqual("invalid_uuid", resp_body['type'])
+        self.assertEqual("Invalid UUID pool_id: foo",
+                         resp_body['message'])
diff --git a/designate_tempest_plugin/tests/api/v2/test_tld.py b/designate_tempest_plugin/tests/api/v2/test_tld.py
index e4d82f7..ee74d86 100644
--- a/designate_tempest_plugin/tests/api/v2/test_tld.py
+++ b/designate_tempest_plugin/tests/api/v2/test_tld.py
@@ -16,6 +16,7 @@
 from tempest import test
 from tempest.lib import decorators
 from tempest.lib import exceptions as lib_exc
+from tempest.lib.common.utils import data_utils
 
 from designate_tempest_plugin.tests import base
 
@@ -119,3 +120,84 @@
 
         self.assertRaises(lib_exc.NotFound,
             lambda: self.admin_client.get(uri))
+
+
+class TestTldNotFoundAdmin(BaseTldTest):
+
+    credentials = ["admin"]
+
+    @classmethod
+    def setup_clients(cls):
+        super(TestTldNotFoundAdmin, cls).setup_clients()
+        cls.admin_client = cls.os_adm.tld_client
+
+    @test.attr(type='smoke')
+    @decorators.idempotent_id('b237d5ee-0d76-4294-a3b6-c2f8bf4b0e30')
+    def test_show_tld_404(self):
+        e = self.assertRaises(lib_exc.NotFound,
+                              self.admin_client.show_tld,
+                              data_utils.rand_uuid())
+        self.assertTld404(e.resp, e.resp_body)
+
+    @test.attr(type='smoke')
+    @decorators.idempotent_id('3d128772-7f52-4473-b569-51ae8294667b')
+    def test_update_tld_404(self):
+        e = self.assertRaises(lib_exc.NotFound,
+                              self.admin_client.update_tld,
+                              data_utils.rand_uuid())
+        self.assertTld404(e.resp, e.resp_body)
+
+    @test.attr(type='smoke')
+    @decorators.idempotent_id('18e465e7-5c7d-4775-acef-bd12a8db1095')
+    def test_delete_tld_404(self):
+        e = self.assertRaises(lib_exc.NotFound,
+                              self.admin_client.delete_tld,
+                              data_utils.rand_uuid())
+        self.assertTld404(e.resp, e.resp_body)
+
+    def assertTld404(self, resp, resp_body):
+        self.assertEqual(404, resp.status)
+        self.assertEqual(404, resp_body['code'])
+        self.assertEqual("tld_not_found", resp_body['type'])
+        self.assertEqual("Could not find Tld", resp_body['message'])
+
+
+class TestTldInvalidIdAdmin(BaseTldTest):
+
+    credentials = ["admin"]
+
+    @classmethod
+    def setup_clients(cls):
+        super(TestTldInvalidIdAdmin, cls).setup_clients()
+        cls.admin_client = cls.os_adm.tld_client
+
+    @test.attr(type='smoke')
+    @decorators.idempotent_id('f9ec0730-57ff-4720-8d06-e11d377c7cfc')
+    def test_show_tld_invalid_uuid(self):
+        e = self.assertRaises(lib_exc.BadRequest,
+                              self.admin_client.show_tld,
+                              'foo')
+        self.assertTldInvalidId(e.resp, e.resp_body)
+
+    @test.attr(type='smoke')
+    @decorators.idempotent_id('13dc6518-b479-4502-90f5-f5a5ecc8b1fb')
+    def test_update_tld_invalid_uuid(self):
+        e = self.assertRaises(lib_exc.BadRequest,
+                              self.admin_client.update_tld,
+                              'foo')
+        self.assertTldInvalidId(e.resp, e.resp_body)
+
+    @test.attr(type='smoke')
+    @decorators.idempotent_id('6a6fc9db-9a73-4ffc-831a-172e1cbc7394')
+    def test_delete_tld_invalid_uuid(self):
+        e = self.assertRaises(lib_exc.BadRequest,
+                              self.admin_client.delete_tld,
+                              'foo')
+        self.assertTldInvalidId(e.resp, e.resp_body)
+
+    def assertTldInvalidId(self, resp, resp_body):
+        self.assertEqual(400, resp.status)
+        self.assertEqual(400, resp_body['code'])
+        self.assertEqual("invalid_uuid", resp_body['type'])
+        self.assertEqual("Invalid UUID tld_id: foo",
+                         resp_body['message'])
