diff --git a/plstackapi/core/api/__init__.py b/plstackapi/core/api/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plstackapi/core/api/__init__.py
diff --git a/plstackapi/core/api/auth.py b/plstackapi/core/api/auth.py
new file mode 100644
index 0000000..4054da6
--- /dev/null
+++ b/plstackapi/core/api/auth.py
@@ -0,0 +1,8 @@
+from plstackapi.openstack.client import OpenStackClient
+
+def auth_check(auth):
+    client = OpenStackClient(username=auth['Username'],
+                             password=auth['AuthString'],
+                             tenant=auth['LoginBase'])
+    client.authenticate()
+    return client
diff --git a/plstackapi/core/api/deployment_networks.py b/plstackapi/core/api/deployment_networks.py
new file mode 100644
index 0000000..812ca15
--- /dev/null
+++ b/plstackapi/core/api/deployment_networks.py
@@ -0,0 +1,26 @@
+from plstackapi.openstack.client import OpenStackClient
+from plstackapi.openstack.driver import OpenStackDriver
+from plstackapi.core.api.auth import auth_check
+from plstackapi.core.models import DeploymentNetwork
+ 
+
+def add_deployment_network(auth, name):
+    auth_check(auth)    
+    deployment = DeploymentNetwork(name=name)
+    deployment.save()
+    return deployment
+
+def delete_deployment_network(auth, filter={}):
+    auth_check(auth)   
+    deployments = DeploymentNetwork.objects.filter(**filter)
+    for deployment in deployments:
+        deployment.delete()
+    return 1
+
+def get_deployment_networks(auth, filter={}):
+    auth_check(auth)   
+    deployments = DeploymentNetwork.objects.filter(**filter)
+    return deployments             
+        
+
+    
diff --git a/plstackapi/core/api/flavors.py b/plstackapi/core/api/flavors.py
new file mode 100644
index 0000000..a2d0b23
--- /dev/null
+++ b/plstackapi/core/api/flavors.py
@@ -0,0 +1,21 @@
+from plstackapi.openstack.client import OpenStackClient
+from plstackapi.openstack.driver import OpenStackDriver
+from plstackapi.core.api.auth import auth_check
+from plstackapi.core.models import Flavor
+ 
+
+def add_flavor(auth, fields={}):
+    """not implemented"""
+    return 
+
+def delete_flavor(auth, filter={}):
+    """not implemented"""
+    return 1
+
+def get_flavors(auth, filter={}):
+    auth_check(auth)   
+    flavors = Flavor.objects.filter(**filter)
+    return flavors             
+        
+
+    
diff --git a/plstackapi/core/api/images.py b/plstackapi/core/api/images.py
new file mode 100644
index 0000000..b773b0b
--- /dev/null
+++ b/plstackapi/core/api/images.py
@@ -0,0 +1,21 @@
+from plstackapi.openstack.client import OpenStackClient
+from plstackapi.openstack.driver import OpenStackDriver
+from plstackapi.core.api.auth import auth_check
+from plstackapi.core.models import Image
+ 
+
+def add_image(auth, fields={}):
+    """not implemented"""
+    return 
+
+def delete_image(auth, filter={}):
+    """not implemented"""
+    return 1
+
+def get_images(auth, filter={}):
+    auth_check(auth)   
+    images = Image.objects.filter(**filter)
+    return images             
+        
+
+    
diff --git a/plstackapi/core/api/keys.py b/plstackapi/core/api/keys.py
new file mode 100644
index 0000000..af21f41
--- /dev/null
+++ b/plstackapi/core/api/keys.py
@@ -0,0 +1,45 @@
+from plstackapi.openstack.client import OpenStackClient
+from plstackapi.openstack.driver import OpenStackDriver
+from plstackapi.core.api.auth import auth_check
+from plstackapi.core.models import Key, User
+ 
+def lookup_user(fields):
+    user = None
+    if 'user' in fields:
+        if isinstance(fields['user'], int):
+            users = User.objects.filter(id=fields['user'])
+        else:
+            users = User.objects.filter(email=fields['user'])
+        if users:
+            user = users[0]
+    return user 
+
+def add_key(auth, fields):
+    driver = OpenStackDriver(client = auth_check(auth))
+    user = lookup_user(fields) 
+    if user: fields['user'] = user     
+    key = Key(**fields)
+    nova_fields = {'name': key.name,
+                   'key': key.key} 
+    nova_key = driver.create_keypair(**nova_fields)
+    key.save()
+    return key
+
+def update_key(auth, id, **fields):
+    return  
+
+def delete_key(auth, filter={}):
+    driver = OpenStackDriver(client = auth_check(auth))   
+    keys = Key.objects.filter(**filter)
+    for key in keys:
+        driver.delete_keypair(name=key.name) 
+        key.delete()
+    return 1
+
+def get_keys(auth, filter={}):
+    client = auth_check(auth)
+    keys = Key.objects.filter(**filter)
+    return keys             
+        
+
+    
diff --git a/plstackapi/core/api/roles.py b/plstackapi/core/api/roles.py
new file mode 100644
index 0000000..844fb4f
--- /dev/null
+++ b/plstackapi/core/api/roles.py
@@ -0,0 +1,28 @@
+from plstackapi.openstack.client import OpenStackClient
+from plstackapi.openstack.driver import OpenStackDriver
+from plstackapi.core.api.auth import auth_check
+from plstackapi.core.models import Role
+ 
+
+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)
+    role.save()
+    return role
+
+def delete_role(auth, filter={}):
+    driver = OpenStackDriver(client = auth_check(auth))   
+    roles = Role.objects.filter(**filter)
+    for role in roles:
+        driver.delete_role({'id': role.role_id}) 
+        role.delete()
+    return 1
+
+def get_roles(auth, filter={}):
+    client = auth_check(auth)
+    roles = Role.objects.filter(**filter)
+    return roles             
+        
+
+    
diff --git a/plstackapi/core/api/sites.py b/plstackapi/core/api/sites.py
new file mode 100644
index 0000000..0d07605
--- /dev/null
+++ b/plstackapi/core/api/sites.py
@@ -0,0 +1,48 @@
+from plstackapi.openstack.client import OpenStackClient
+from plstackapi.openstack.driver import OpenStackDriver
+from plstackapi.core.api.auth import auth_check
+from plstackapi.core.models import Site
+ 
+
+def add_site(auth, fields):
+    driver = OpenStackDriver(client = auth_check(auth))
+    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.save()
+    return site
+
+def update_site(auth, id, **fields):
+    driver = OpenStackDriver(client = auth_check(auth))
+    sites = Site.objects.filter(id=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.update(**fields)
+    return site 
+
+def delete_site(auth, filter={}):
+    driver = OpenStackDriver(client = auth_check(auth))   
+    sites = Site.objects.filter(**filter)
+    for site in sites:
+        driver.delete_tenant(id=site.tenant_id) 
+        site.delete()
+    return 1
+
+def get_sites(auth, filter={}):
+    client = auth_check(auth)
+    sites = Site.objects.filter(**filter)
+    return sites             
+        
+
+    
diff --git a/plstackapi/core/api/users.py b/plstackapi/core/api/users.py
new file mode 100644
index 0000000..6862e30
--- /dev/null
+++ b/plstackapi/core/api/users.py
@@ -0,0 +1,67 @@
+from plstackapi.openstack.client import OpenStackClient
+from plstackapi.openstack.driver import OpenStackDriver
+from plstackapi.core.api.auth import auth_check
+from plstackapi.core.models import User, Site
+ 
+def lookup_site(fields):
+    site = None
+    if 'site' in fields:
+        if isinstance(fields['site'], int):
+            sites = Site.objects.filter(id=fields['site'])
+        else:
+            sites = Site.objects.filter(login_base=fields['site'])
+        if sites:
+            site = sites[0]
+    return site 
+
+def add_user(auth, fields):
+    driver = OpenStackDriver(client = auth_check(auth))
+    site = lookup_site(fields) 
+    if site: fields['site'] = site     
+    user = User(**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_role(user.id, user.site.tenant_id, 'user')
+    user.user_id=nova_user.id
+    user.save()
+    return user
+
+def update_user(auth, id, **fields):
+    driver = OpenStackDriver(client = auth_check(auth))
+    users = User.objects.filter(id=id)
+    if not users:
+        return
+
+    user = users[0]
+    nova_fields = {}
+    if 'email' in fields:
+        nova_fields['name'] = fields['email'][:self.email.find('@')]
+        nova_fields['email'] = fields['email']
+    if 'password' in fields:
+        nova_fields['password'] = fields['password']
+    if 'enabled' in fields:
+        nova_fields['enabled'] = fields['enabled']
+    driver.update_user(user.user_id, **nova_fields)
+    site = lookup_site(fields)
+    if site: fields['site'] = site
+    user.update(**fields)
+    return user 
+
+def delete_user(auth, filter={}):
+    driver = OpenStackDriver(client = auth_check(auth))   
+    users = User.objects.filter(**filter)
+    for user in users:
+        driver.delete_user(id=user.user_id) 
+        user.delete()
+    return 1
+
+def get_users(auth, filter={}):
+    client = auth_check(auth)
+    users = User.objects.filter(**filter)
+    return users             
+        
+
+    
