diff --git a/tempest/api/image/v2/test_images_member.py b/tempest/api/image/v2/test_images_member.py
index d68ceff..98ff64b 100644
--- a/tempest/api/image/v2/test_images_member.py
+++ b/tempest/api/image/v2/test_images_member.py
@@ -20,14 +20,14 @@
     def test_image_share_accept(self):
         image_id = self._create_image()
         member = self.os_img_client.add_image_member(image_id,
-                                                     self.alt_tenant_id)
+                                                     member=self.alt_tenant_id)
         self.assertEqual(member['member_id'], self.alt_tenant_id)
         self.assertEqual(member['image_id'], image_id)
         self.assertEqual(member['status'], 'pending')
         self.assertNotIn(image_id, self._list_image_ids_as_alt())
         self.alt_img_client.update_image_member(image_id,
                                                 self.alt_tenant_id,
-                                                {'status': 'accepted'})
+                                                status='accepted')
         self.assertIn(image_id, self._list_image_ids_as_alt())
         body = self.os_img_client.list_image_members(image_id)
         members = body['members']
@@ -41,24 +41,24 @@
     def test_image_share_reject(self):
         image_id = self._create_image()
         member = self.os_img_client.add_image_member(image_id,
-                                                     self.alt_tenant_id)
+                                                     member=self.alt_tenant_id)
         self.assertEqual(member['member_id'], self.alt_tenant_id)
         self.assertEqual(member['image_id'], image_id)
         self.assertEqual(member['status'], 'pending')
         self.assertNotIn(image_id, self._list_image_ids_as_alt())
         self.alt_img_client.update_image_member(image_id,
                                                 self.alt_tenant_id,
-                                                {'status': 'rejected'})
+                                                status='rejected')
         self.assertNotIn(image_id, self._list_image_ids_as_alt())
 
     @test.idempotent_id('a6ee18b9-4378-465e-9ad9-9a6de58a3287')
     def test_get_image_member(self):
         image_id = self._create_image()
         self.os_img_client.add_image_member(image_id,
-                                            self.alt_tenant_id)
+                                            member=self.alt_tenant_id)
         self.alt_img_client.update_image_member(image_id,
                                                 self.alt_tenant_id,
-                                                {'status': 'accepted'})
+                                                status='accepted')
 
         self.assertIn(image_id, self._list_image_ids_as_alt())
         member = self.os_img_client.show_image_member(image_id,
@@ -71,10 +71,10 @@
     def test_remove_image_member(self):
         image_id = self._create_image()
         self.os_img_client.add_image_member(image_id,
-                                            self.alt_tenant_id)
+                                            member=self.alt_tenant_id)
         self.alt_img_client.update_image_member(image_id,
                                                 self.alt_tenant_id,
-                                                {'status': 'accepted'})
+                                                status='accepted')
 
         self.assertIn(image_id, self._list_image_ids_as_alt())
         self.os_img_client.delete_image_member(image_id, self.alt_tenant_id)
@@ -94,14 +94,14 @@
     def test_get_private_image(self):
         image_id = self._create_image()
         member = self.os_img_client.add_image_member(image_id,
-                                                     self.alt_tenant_id)
+                                                     member=self.alt_tenant_id)
         self.assertEqual(member['member_id'], self.alt_tenant_id)
         self.assertEqual(member['image_id'], image_id)
         self.assertEqual(member['status'], 'pending')
         self.assertNotIn(image_id, self._list_image_ids_as_alt())
         self.alt_img_client.update_image_member(image_id,
                                                 self.alt_tenant_id,
-                                                {'status': 'accepted'})
+                                                status='accepted')
         self.assertIn(image_id, self._list_image_ids_as_alt())
         self.os_img_client.delete_image_member(image_id, self.alt_tenant_id)
         self.assertNotIn(image_id, self._list_image_ids_as_alt())
diff --git a/tempest/api/image/v2/test_images_member_negative.py b/tempest/api/image/v2/test_images_member_negative.py
index ae8913c..d5ea291 100644
--- a/tempest/api/image/v2/test_images_member_negative.py
+++ b/tempest/api/image/v2/test_images_member_negative.py
@@ -23,22 +23,22 @@
     def test_image_share_invalid_status(self):
         image_id = self._create_image()
         member = self.os_img_client.add_image_member(image_id,
-                                                     self.alt_tenant_id)
+                                                     member=self.alt_tenant_id)
         self.assertEqual(member['status'], 'pending')
         self.assertRaises(lib_exc.BadRequest,
                           self.alt_img_client.update_image_member,
                           image_id, self.alt_tenant_id,
-                          {'status': 'notavalidstatus'})
+                          status='notavalidstatus')
 
     @test.attr(type=['negative'])
     @test.idempotent_id('27002f74-109e-4a37-acd0-f91cd4597967')
     def test_image_share_owner_cannot_accept(self):
         image_id = self._create_image()
         member = self.os_img_client.add_image_member(image_id,
-                                                     self.alt_tenant_id)
+                                                     member=self.alt_tenant_id)
         self.assertEqual(member['status'], 'pending')
         self.assertNotIn(image_id, self._list_image_ids_as_alt())
         self.assertRaises(lib_exc.Forbidden,
                           self.os_img_client.update_image_member,
-                          image_id, self.alt_tenant_id, {'status': 'accepted'})
+                          image_id, self.alt_tenant_id, status='accepted')
         self.assertNotIn(image_id, self._list_image_ids_as_alt())
diff --git a/tempest/services/image/v2/json/image_client.py b/tempest/services/image/v2/json/image_client.py
index 6b9ec32..a7e0f04 100644
--- a/tempest/services/image/v2/json/image_client.py
+++ b/tempest/services/image/v2/json/image_client.py
@@ -178,17 +178,17 @@
         body = json.loads(body)
         return service_client.ResponseBody(resp, body)
 
-    def add_image_member(self, image_id, member_id):
+    def add_image_member(self, image_id, **kwargs):
         url = 'v2/images/%s/members' % image_id
-        data = json.dumps({'member': member_id})
+        data = json.dumps(kwargs)
         resp, body = self.post(url, data)
         self.expected_success(200, resp.status)
         body = json.loads(body)
         return service_client.ResponseBody(resp, body)
 
-    def update_image_member(self, image_id, member_id, body):
+    def update_image_member(self, image_id, member_id, **kwargs):
         url = 'v2/images/%s/members/%s' % (image_id, member_id)
-        data = json.dumps(body)
+        data = json.dumps(kwargs)
         resp, body = self.put(url, data)
         self.expected_success(200, resp.status)
         body = json.loads(body)
@@ -220,19 +220,13 @@
         body = json.loads(body)
         return service_client.ResponseBody(resp, body)
 
-    def create_namespace(self, namespace, **kwargs):
-        params = {
-            "namespace": namespace,
-        }
+    def create_namespace(self, **kwargs):
+        """Create a namespace.
 
-        for option in kwargs:
-            value = kwargs.get(option)
-            if isinstance(value, dict) or isinstance(value, tuple):
-                params.update(value)
-            else:
-                params[option] = value
-
-        data = json.dumps(params)
+        Available params: see http://developer.openstack.org/
+                              api-ref-image-v2.html#createNamespace-v2
+        """
+        data = json.dumps(kwargs)
         self._validate_schema(data)
 
         resp, body = self.post('/v2/metadefs/namespaces', data)
@@ -247,18 +241,16 @@
         body = json.loads(body)
         return service_client.ResponseBody(resp, body)
 
-    def update_namespace(self, namespace, visibility, **kwargs):
-        params = {
-            "namespace": namespace,
-            "visibility": visibility
-        }
-        for option in kwargs:
-            value = kwargs.get(option)
-            if isinstance(value, dict) or isinstance(value, tuple):
-                params.update(value)
-            else:
-                params[option] = value
+    def update_namespace(self, namespace, **kwargs):
+        """Update a namespace.
 
+        Available params: see http://developer.openstack.org/
+                              api-ref-image-v2.html#updateNamespace-v2
+        """
+        # NOTE: On Glance API, we need to pass namespace on both URI
+        # and a request body.
+        params = {'namespace': namespace}
+        params.update(kwargs)
         data = json.dumps(params)
         self._validate_schema(data)
         url = '/v2/metadefs/namespaces/%s' % namespace
