diff --git a/plstackapi/core/api/auth.py b/plstackapi/core/api/auth.py
index 412df00..0c4f6d8 100644
--- a/plstackapi/core/api/auth.py
+++ b/plstackapi/core/api/auth.py
@@ -1,4 +1,5 @@
-from plstackapi.openstack.client import OpenStackClient
+from django.contrib.auth import authenticate
+from plstackapi.openstack.manager import OpenStackManager
 
 def auth_check(username, password, tenant):
     client = OpenStackClient(username=username,
diff --git a/plstackapi/core/api/deployment_networks.py b/plstackapi/core/api/deployment_networks.py
index 00ee2e8..3db7285 100644
--- a/plstackapi/core/api/deployment_networks.py
+++ b/plstackapi/core/api/deployment_networks.py
@@ -1,7 +1,5 @@
 from types import StringTypes
-from plstackapi.openstack.client import OpenStackClient
-from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.core.api.auth import auth_check
+from django.contrib.auth import authenticate
 from plstackapi.core.models import DeploymentNetwork
 
 def _get_deployment_networks(filter):
@@ -18,20 +16,23 @@
     return deployment_networks 
 
 def add_deployment_network(auth, name):
-    auth_check(auth)    
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
     deployment = DeploymentNetwork(name=name)
     deployment.save()
     return deployment
 
 def delete_deployment_network(auth, filter={}):
-    auth_check(auth)   
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
     deployments = _get_deployment_networks(filter)
     for deployment in deployments:
         deployment.delete()
     return 1
 
 def get_deployment_networks(auth, filter={}):
-    auth_check(auth)   
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
     deployments = _get_deployment_networks(filter)
     return deployments             
         
diff --git a/plstackapi/core/api/images.py b/plstackapi/core/api/images.py
index 8fd6141..ec18c11 100644
--- a/plstackapi/core/api/images.py
+++ b/plstackapi/core/api/images.py
@@ -1,7 +1,5 @@
 from types import StringTypes
-from plstackapi.openstack.client import OpenStackClient
-from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.core.api.auth import auth_check
+from django.contrib.auth import authenticate
 from plstackapi.core.models import Image
  
 def _get_images(filter):
@@ -26,7 +24,8 @@
     return 1
 
 def get_images(auth, filter={}):
-    auth_check(auth)   
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
     images = _get_images(filter)
     return images             
         
diff --git a/plstackapi/core/api/keys.py b/plstackapi/core/api/keys.py
index 3b70cac..66af59e 100644
--- a/plstackapi/core/api/keys.py
+++ b/plstackapi/core/api/keys.py
@@ -1,7 +1,6 @@
 from types import StringTypes
-from plstackapi.openstack.client import OpenStackClient
-from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.core.api.auth import auth_check
+from django.contrib.auth import authenticate
+from plstackapi.openstack.manager import OpenStackManager
 from plstackapi.core.models import Key
 from plstackapi.core.api.users import _get_users
 
@@ -20,14 +19,17 @@
     return keys 
 
 def add_key(auth, fields):
-    driver = OpenStackDriver(client = auth_check(auth))
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
+    auth['tenant'] = user.site.login_base
+    manager = OpenStackManager(auth=auth, caller = user)
+
+    # look up user object
     users = _get_users(fields.get('user')) 
     if users: fields['user'] = users[0]    
+    # save
     key = Key(**fields)
-    nova_fields = {'name': key.name,
-                   'key': key.key} 
-    nova_key = driver.create_keypair(**nova_fields)
-    key.key_id = nova_key.id
+    key.os_manager = manager
     key.save()
     return key
 
@@ -35,15 +37,20 @@
     return  
 
 def delete_key(auth, filter={}):
-    driver = OpenStackDriver(client = auth_check(auth))   
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
+    auth['tenant'] = user.site.login_base
+    manager = OpenStackManager(auth=auth, caller = user)
+
     keys = _get_keys(filter)
     for key in keys:
-        driver.delete_keypair(id=key.key_id) 
+        key.os_manager = manager
         key.delete()
     return 1
 
 def get_keys(auth, filter={}):
-    client = auth_check(auth)
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
     keys = _get_keys(filter)
     return keys             
         
diff --git a/plstackapi/core/api/nodes.py b/plstackapi/core/api/nodes.py
index 9b6a65c..e5332eb 100644
--- a/plstackapi/core/api/nodes.py
+++ b/plstackapi/core/api/nodes.py
@@ -1,7 +1,5 @@
 from types import StringTypes
-from plstackapi.openstack.client import OpenStackClient
-from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.core.api.auth import auth_check
+from django.contrib.auth import authenticate
 from plstackapi.core.models import Node
  
 def _get_nodes(filter):
@@ -29,7 +27,8 @@
     return 
 
 def get_nodes(auth, filter={}):
-    auth_check(auth)   
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
     nodes = _get_nodes(filter)
     return nodes             
         
diff --git a/plstackapi/core/api/roles.py b/plstackapi/core/api/roles.py
index b243d78..bf74222 100644
--- a/plstackapi/core/api/roles.py
+++ b/plstackapi/core/api/roles.py
@@ -1,7 +1,6 @@
 from types import StringTypes
-from plstackapi.openstack.client import OpenStackClient
-from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.core.api.auth import auth_check
+from django.contrib.auth import authenticate
+from plstackapi.openstack.manager import OpenStackManager
 from plstackapi.core.models import Role
  
 
@@ -19,21 +18,27 @@
     return roles
 
 def add_role(auth, name):
-    driver = OpenStackDriver(client = auth_check(auth))    
-    keystone_role = driver.create_role(name=name)
-    role = Role(role_type=name, role_id=keystone_role.id)
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
+    auth['tenant'] = user.site.login_base
+
+    role = Role(role_type=name)
+    role.os_manager = OpenStackManager(auth=auth, caller = user) 
     role.save()
     return role
 
 def delete_role(auth, filter={}):
-    driver = OpenStackDriver(client = auth_check(auth))   
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
     roles = _get_roles(filter) 
     for role in roles:
-        driver.delete_role({'id': role.role_id}) 
+        auth['tenant'] = user.site.login_base
+        role.os_manager = OpenStackManager(auth=auth, caller = user)
         role.delete()
     return 1
 
 def get_roles(auth, filter={}):
-    client = auth_check(auth)
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
     return _get_roles(filter)             
         
diff --git a/plstackapi/core/api/site_privileges.py b/plstackapi/core/api/site_privileges.py
index ac56dd1..d425728 100644
--- a/plstackapi/core/api/site_privileges.py
+++ b/plstackapi/core/api/site_privileges.py
@@ -1,8 +1,7 @@
 from types import StringTypes
 import re
-from plstackapi.openstack.client import OpenStackClient
-from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.core.api.auth import auth_check
+from django.contrib.auth import authenticate
+from plstackapi.openstack.manager import OpenStackManager
 from plstackapi.core.models import SitePrivilege
 from plstackapi.core.api.users import _get_users
 from plstackapi.core.api.sites import _get_sites
@@ -23,7 +22,9 @@
     return site_privileges
  
 def add_site_privilege(auth, fields):
-    driver = OpenStackDriver(client = auth_check(auth))
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
+
     users = _get_user(fields.get('user')) 
     sites = _get_slice(fields.get('site')) 
     roles = _get_role(fields.get('role'))
@@ -32,13 +33,9 @@
     if slices: fields['site'] = sites[0] 
     if roles: fields['role'] = roles[0]
  
+    auth['tenant'] = sites[0].login_base
     site_privilege = SitePrivilege(**fields)
-
-    # update nova role
-    driver.add_user_role(site_privilege.user.user_id, 
-                         site_privilege.site.tenant_id, 
-                         site_privilege.role.name)
-    
+    site_privilege.os_manager = OpenStackManager(auth=auth, caller = user) 
     site_privilege.save()
     return site_privilege
 
@@ -46,17 +43,21 @@
     return  
 
 def delete_site_privilege(auth, filter={}):
-    driver = OpenStackDriver(client = auth_check(auth))   
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
+    auth['tenant'] = user.site.login_base
+    manager = OpenStackManager(auth=auth, caller = user)
+
     site_privileges = _get_site_privileges(filter)
     for site_privilege in site_privileges:
-        driver.delete_user_role(user_id=site_privilege.user.id,
-                                tenant_id = site_privilege.site.tenant_id,
-                                role_name = site_privilege.role.name) 
+        auth['tenant'] = user.site.login_base
+        site_privilege.os_manager = OpenStackManager(auth=auth, caller = user)
         site_privilege.delete()
     return 1
 
 def get_site_privileges(auth, filter={}):
-    client = auth_check(auth)
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
     users = _get_users(filter.get('user'))
     sites = _get_slices(filter.get('site'))
     roles = _get_roles(filter.get('role'))
diff --git a/plstackapi/core/api/sites.py b/plstackapi/core/api/sites.py
index b8c463d..c8bd962 100644
--- a/plstackapi/core/api/sites.py
+++ b/plstackapi/core/api/sites.py
@@ -1,6 +1,6 @@
 from types import StringTypes
-from plstackapi.openstack.client import OpenStackClient
-from plstackapi.openstack.driver import OpenStackDriver
+from django.contrib.auth import authenticate
+from plstackapi.openstack.manager import OpenStackManager    
 from plstackapi.core.api.auth import auth_check
 from plstackapi.core.models import Site
 
@@ -19,42 +19,42 @@
     return sites 
 
 def add_site(auth, fields):
-    driver = OpenStackDriver(client = auth_check(auth))
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
+    auth['tenant'] = user.site.login_base
+
     site = Site(**fields)
-    nova_fields = {'tenant_name': site.login_base,
-                   'description': site.name,
-                   'enabled': site.enabled}    
-    tenant = driver.create_tenant(**nova_fields)
-    site.tenant_id=tenant.id
+    site.os_manager = OpenStackManager(auth=auth, caller = user)
     site.save()
     return site
 
 def update_site(auth, id, **fields):
-    driver = OpenStackDriver(client = auth_check(auth))
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
+    auth['tenant'] = user.site.login_base
+
     sites = _get_sites(id)
     if not sites:
         return
 
     site = Site[0]
-    nova_fields = {}
-    if 'description' in fields:
-        nova_fields['description'] = fields['name']
-    if 'enabled' in fields:
-        nova_fields['enabled'] = fields['enabled']
-    driver.update_tenant(site.tenant_id, **nova_fields)
+    site.os_manager = OpenStackManager(auth=auth, caller = user)
     site.update(**fields)
     return site 
 
 def delete_site(auth, filter={}):
-    driver = OpenStackDriver(client = auth_check(auth))   
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
+    auth['tenant'] = user.site.login_base
     sites = _get_sites(id)
     for site in sites:
-        driver.delete_tenant(id=site.tenant_id) 
+        site.os_manager = OpenStackManager(auth=auth, caller = user)
         site.delete()
     return 1
 
 def get_sites(auth, filter={}):
-    client = auth_check(auth)
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
     sites = _get_sites(filter)
     return sites             
         
diff --git a/plstackapi/core/api/slice_memberships.py b/plstackapi/core/api/slice_memberships.py
index 431552d..ae6baa4 100644
--- a/plstackapi/core/api/slice_memberships.py
+++ b/plstackapi/core/api/slice_memberships.py
@@ -1,7 +1,6 @@
 from types import StringTypes
-from plstackapi.openstack.client import OpenStackClient
-from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.core.api.auth import auth_check
+from django.contrib.auth import authenticate
+from plstackapi.openstack.manager import OpenStackManager
 from plstackapi.core.models import SliceMembership
 from plstackapi.core.api.users import _get_users
 from plstackapi.core.api.slices import _get_slices
@@ -22,7 +21,9 @@
 
  
 def add_slice_membership(auth, fields):
-    driver = OpenStackDriver(client = auth_check(auth))
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
+
     users = _get_users(fields.get('user')) 
     slices = _get_slices(fields.get('slice')) 
     roles = _get_roles(fields.get('role'))
@@ -32,12 +33,8 @@
     if roles: fields['role'] = roles[0]
  
     slice_membership = SliceMembership(**fields)
-
-    # update nova role
-    driver.add_user_role(slice_membership.user.user_id, 
-                         slice_membership.slice.tenant_id, 
-                         slice_membership.role.name)
-    
+    auth['tenant'] = sites[0].login_base
+    slice_membership.os_manager = OpenStackManager(auth=auth, caller = user) 
     slice_membership.save()
     return slice_membership
 
@@ -45,17 +42,19 @@
     return  
 
 def delete_slice_membership(auth, filter={}):
-    driver = OpenStackDriver(client = auth_check(auth))   
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
+    auth['tenant'] = user.site.login_base
+
     slice_memberships = _get_slice_memberships(filter)
     for slice_membership in slice_memberships:
-        driver.delete_user_role(user_id=slice_membership.user.id,
-                                tenant_id = slice_membership.slice.tenant_id,
-                                role_name = slice_membership.role.name) 
+        slice_membership.os_manager = OpenStackManager(auth=auth, caller = user)
         slice_membership.delete()
     return 1
 
 def get_slice_memberships(auth, filter={}):
-    client = auth_check(auth)
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
     users = _get_users(fields.get('user'))
     slices = _get_slices(fields.get('slice'))
     roles = _get_roles(fields.get('role'))
diff --git a/plstackapi/core/api/slices.py b/plstackapi/core/api/slices.py
index eda2249..f55249a 100644
--- a/plstackapi/core/api/slices.py
+++ b/plstackapi/core/api/slices.py
@@ -1,9 +1,7 @@
 import re
 from types import StringTypes
 from django.contrib.auth import authenticate
-from plstackapi.openstack.client import OpenStackClient
-from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.core.api.auth import auth_check
+from plstackapi.openstack.manager import OpenStackManager
 from plstackapi.core.models import Slice
 from plstackapi.core.api.sites import _get_sites
 
@@ -22,61 +20,44 @@
     
  
 def add_slice(auth, fields):
-    driver = OpenStackDriver(client = auth_check(auth))
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
+    auth['tenant'] = user.site.login_base
+
     login_base = fields['name'][:fields['name'].find('_')]
     sites = _get_sites(login_base) 
     if sites: fields['site'] = sites[0]     
     slice = Slice(**fields)
-   
-    # create tenant
-    nova_fields = {'tenant_name': slice.name,
-                   'description': slice.description,
-                   'enabled': slice.enabled}
-    tenant = driver.create_tenant(**nova_fields)
-    slice.tenant_id=tenant.id
-    
-    # create network
-    network = driver.create_network(slice.name)
-    slice.network_id = network['id']
-
-    # create router
-    router = driver.create_router(slice.name)
-    slice.router_id = router['id']    
-
+    slice.os_manager = OpenStackManager(auth=auth, caller = user) 
     slice.save()
     return slice
 
 def update_slice(auth, id, **fields):
-    driver = OpenStackDriver(client = auth_check(auth))
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
+    auth['tenant'] = user.site.login_base
+
     slices = _get_slices(id)
     if not slices:
         return
-
-    # update tenant
     slice = slices[0]
-    nova_fields = {}
-    if 'name' in fields:
-        nova_fields['tenant_name'] = fields['name']
-    if 'description' in fields:
-        nova_fields['description'] = fields['description']
-    if 'enabled' in fields:
-        nova_fields['enabled'] = fields['enabled']
-    driver.update_tenant(slice.tenant_id, **nova_fields)
-
-    # update db record 
     sites = _get_sites(fields.get('site'))
     if sites: fields['site'] = sites[0]
-    slice.update(**fields)
+
+    slice.os_manager = OpenStackManager(auth=auth, caller = user)
+    for (k,v) in fields.items():
+        setattr(slice, k, v)
+    slice.save()
 
     return slice 
 
 def delete_slice(auth, filter={}):
-    driver = OpenStackDriver(client = auth_check(auth))   
-    slices = _get_slices(id)
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
+    auth['tenant'] = user.site.login_base
+    slices = _get_slices(filter)
     for slice in slices:
-        driver.delete_network(slice.network_id)
-        driver.delete_router(slice.router_id)
-        driver.delete_slice(id=slice.tenant_id) 
+        slice.os_manager = OpenStackManager(auth=auth, caller = user) 
         slice.delete()
     return 1
 
diff --git a/plstackapi/core/api/slivers.py b/plstackapi/core/api/slivers.py
index cc45b8d..f832dae 100644
--- a/plstackapi/core/api/slivers.py
+++ b/plstackapi/core/api/slivers.py
@@ -1,8 +1,6 @@
 from types import StringTypes
 from django.contrib.auth import authenticate
-from plstackapi.openstack.client import OpenStackClient
-from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.core.api.auth import auth_check
+from plstackapi.openstack.manager import OpenStackManager
 from plstackapi.core.models import Sliver, Slice
 from plstackapi.core.api.images import _get_images
 from plstackapi.core.api.keys import _get_keys
@@ -25,21 +23,23 @@
     return slivers
  
 def add_sliver(auth, fields):
-    driver = OpenStackDriver(client = auth_check(auth))
-        
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
+    
     images = _get_images(fields.get('image'))
-    if images: fields['image'] = images[0]     
     keys = _get_keys(fields.get('key'))
-    if keys: fields['key'] = keys[0]     
     slices = _get_slices(fields.get('slice'))
-    if slices: 
-        fields['slice'] = slices[0]     
     deployment_networks = _get_deployment_networks(fields.get('deploymentNetwork'))
-    if deployment_networks: fields['deploymentNetwork'] = deployment_networks[0]     
     nodes = _get_nodes(fields.get('node'))
+    if images: fields['image'] = images[0]     
+    if keys: fields['key'] = keys[0]     
+    if slices: fields['slice'] = slices[0]     
+    if deployment_networks: fields['deploymentNetwork'] = deployment_networks[0]     
     if nodes: fields['node'] = nodes[0]     
+
     sliver = Sliver(**fields)
-    sliver.driver = driver    
+    auth['tenant'] = sliver.slice.name
+    sliver.os_manager = OpenStackManager(auth=auth, caller = user)    
     sliver.save()
     return sliver
 
@@ -47,10 +47,12 @@
     return  
 
 def delete_sliver(auth, filter={}):
-    driver = OpenStackDriver(client = auth_check(auth))   
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
     slivers = _get_slivers(filter)
     for sliver in slivers:
-        sliver.driver = driver
+        auth['tenant'] = sliver.slice.name 
+        slice.os_manager = OpenStackManager(auth=auth, caller = user)
         sliver.delete()
     return 1
 
diff --git a/plstackapi/core/api/subnets.py b/plstackapi/core/api/subnets.py
index b62a7ef..e7e85dd 100644
--- a/plstackapi/core/api/subnets.py
+++ b/plstackapi/core/api/subnets.py
@@ -1,8 +1,7 @@
 import commands
 from types import StringTypes
-from plstackapi.openstack.client import OpenStackClient
-from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.core.api.auth import auth_check
+from django.contrib.auth import authenticate
+from plstackapi.openstack.manager import OpenStackManager
 from plstackapi.core.models import Subnet
 from plstackapi.core.api.slices import _get_slices
 
@@ -25,26 +24,14 @@
     return subnets
 
 def add_subnet(auth, fields):
-    driver = OpenStackDriver(client = auth_check(auth))
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
+    
     slices = _get_slices(fields.get('slice')) 
     if slices: fields['slice'] = slices[0]     
     subnet = Subnet(**fields)
-    # create quantum subnet
-    quantum_subnet = driver.create_subnet(name= subnet.slice.name,
-                                          network_id=subnet.slice.network_id,
-                                          cidr_ip = subnet.cidr,
-                                          ip_version=subnet.ip_version,
-                                          start = subnet.start,
-                                          end = subnet.end)
-    subnet.subnet_id=quantum_subnet['id']
-    ## set dns servers
-    #driver.update_subnet(subnet.id, {'dns_nameservers': ['8.8.8.8', '8.8.4.4']})
-
-    # add subnet as interface to slice's router
-    try: driver.add_router_interface(subnet.slice.router_id, subnet.subnet_id)
-    except: pass         
-    #add_route = 'route add -net %s dev br-ex gw 10.100.0.5' % self.cidr
-    commands.getstatusoutput(add_route)    
+    auth['tenant'] = subnet.slice.name
+    subnet.os_manager = OpenStackManager(auth=auth, caller = user)
     subnet.save()
     return subnet
 
@@ -52,18 +39,18 @@
     return  
 
 def delete_subnet(auth, filter={}):
-    driver = OpenStackDriver(client = auth_check(auth))   
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
     subnets = Subnet.objects.filter(**filter)
     for subnet in subnets:
-        driver.delete_router_interface(subnet.slice.router_id, subnet.subnet_id)
-        driver.delete_subnet(subnet.subnet_id) 
+        auth['tenant'] = subnet.slice.name
+        subnet.os_manager = OpenStackManager(auth=auth, caller = user)
         subnet.delete()
-        #del_route = 'route del -net %s' % subnet.cidr
-    commands.getstatusoutput(del_route)
     return 1
 
 def get_subnets(auth, filter={}):
-    client = auth_check(auth)
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
     if 'slice' in filter:
         slice = _get_slice(filter.get('slice'))
         if slice: filter['slice'] = slice
diff --git a/plstackapi/core/api/users.py b/plstackapi/core/api/users.py
index 5b89389..c190562 100644
--- a/plstackapi/core/api/users.py
+++ b/plstackapi/core/api/users.py
@@ -1,7 +1,6 @@
 from types import StringTypes
-from plstackapi.openstack.client import OpenStackClient
-from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.core.api.auth import auth_check
+from django.contrib.auth import authenticate
+from plstackapi.openstack.manager import OpenStackManager    
 from plstackapi.core.models import PLUser, Site
 from plstackapi.core.api.sites import _get_sites
 
@@ -19,22 +18,22 @@
     return users 
 
 def add_user(auth, fields):
-    driver = OpenStackDriver(client = auth_check(auth))
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
+    auth['tenant'] = user.site.login_base
+
     sites = _get_sites(fields.get('site')) 
     if sites: fields['site'] = sites[0]     
     user = PLUser(**fields)
-    nova_fields = {'name': user.email[:user.email.find('@')],
-                   'email': user.email, 
-                   'password': fields.get('password'),
-                   'enabled': user.enabled}    
-    nova_user = driver.create_user(**nova_fields)
-    #driver.add_user_user(user.id, user.site.tenant_id, 'user')
-    user.user_id=nova_user.id
+    user.os_manager = OpenStackManager(auth=auth, caller = user)
     user.save()
     return user
 
 def update_user(auth, id, **fields):
-    driver = OpenStackDriver(client = auth_check(auth))
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
+    auth['tenant'] = user.site.login_base
+
     users = PLUser.objects.filter(id=id)
     if not users:
         return
@@ -48,22 +47,29 @@
         nova_fields['password'] = fields['password']
     if 'enabled' in fields:
         nova_fields['enabled'] = fields['enabled']
-    driver.update_user(user.user_id, **nova_fields)
+
+    
     sites = _get_sites(fields.get('site'))
     if sites: fields['site'] = sites[0]
-    user.update(**fields)
+    user.os_manager = OpenStackManager(auth=auth, caller = user)
+    for (k,v) in fields.items():
+        setattr(user, k, v)    
+    user.save()
     return user 
 
 def delete_user(auth, filter={}):
-    driver = OpenStackDriver(client = auth_check(auth))   
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
+    auth['tenant'] = user.site.login_base
     users = _get_users(filter)
     for user in users:
-        driver.delete_user(id=user.user_id) 
+        user.os_manager = OpenStackManager(auth=auth, caller = user) 
         user.delete()
     return 1
 
 def get_users(auth, filter={}):
-    client = auth_check(auth)
+    user = authenticate(username=auth.get('username'),
+                        password=auth.get('password'))
     users = _get_users(filter)
     return users             
         
