diff --git a/xos/admin.py b/xos/admin.py
index fa658db..b773883 100644
--- a/xos/admin.py
+++ b/xos/admin.py
@@ -11,7 +11,7 @@
 from django.contrib.contenttypes import generic
 from suit.widgets import LinkedSelect
 from core.models import AddressPool
-from core.admin import ServiceAppAdmin, SliceInline, ServiceAttrAsTabInline, ReadOnlyAwareAdmin, XOSTabularInline, ServicePrivilegeInline, AddressPoolInline
+from core.admin import ServiceAppAdmin, SliceInline, ServiceAttrAsTabInline, ReadOnlyAwareAdmin, XOSTabularInline, ServicePrivilegeInline, AddressPoolInline, SubscriberLinkInline, ProviderLinkInline, ProviderDependencyInline,SubscriberDependencyInline
 from core.middleware import get_request
 
 from functools import update_wrapper
@@ -83,7 +83,7 @@
         'rest_user',
         'rest_pass'
     )
-    inlines = [SliceInline, ServiceAttrAsTabInline, ServicePrivilegeInline, AddressPoolInline]
+    inlines = [SliceInline, ServiceAttrAsTabInline, ServicePrivilegeInline, AddressPoolInline, ProviderDependencyInline,SubscriberDependencyInline]
     form = VRouterServiceForm
 
     extracontext_registered_admins = True
@@ -97,6 +97,7 @@
         # ('tools', 'Tools'),
         ('slices', 'Slices'),
         ('serviceattrs', 'Additional Attributes'),
+        ('servicetenants', 'Dependencies'),
         ('serviceprivileges', 'Privileges'),
     )
 
@@ -113,8 +114,7 @@
 
     def __init__(self,*args,**kwargs):
         super (VRouterTenantForm,self ).__init__(*args,**kwargs)
-        self.fields['kind'].widget.attrs['readonly'] = True
-        self.fields['provider_service'].queryset = VRouterService.objects.all()
+        self.fields['owner'].queryset = VRouterService.objects.all()
         if self.instance:
             # fields for the attributes
             self.fields['gateway_ip'].initial = self.instance.gateway_ip
@@ -122,9 +122,8 @@
             self.fields['cidr'].initial = self.instance.cidr
         if (not self.instance) or (not self.instance.pk):
             # default fields for an 'add' form
-            self.fields['kind'].initial = VROUTER_KIND
             if VRouterService.objects.exists():
-               self.fields["provider_service"].initial = VRouterService.objects.first()
+               self.fields["owner"].initial = VRouterService.objects.first()
 
     def save(self, commit=True):
         return super(VRouterTenantForm, self).save(commit=commit)
@@ -135,18 +134,19 @@
 
 
 class VRouterTenantAdmin(ReadOnlyAwareAdmin):
-    list_display = ('backend_status_icon', 'id', 'subscriber_tenant', 'public_ip')
+    list_display = ('backend_status_icon', 'id', 'public_ip')
     list_display_links = ('backend_status_icon', 'id')
     fieldsets = [(None, {
         'fields': [
-            'backend_status_text', 'kind', 'provider_service', 'subscriber_tenant', 'subscriber_service',
+            'backend_status_text', 'owner',
             'address_pool', 'public_ip', 'public_mac', 'gateway_ip', 'gateway_mac', 'cidr'],
         'classes':['suit-tab suit-tab-general']
     })]
     readonly_fields = ('backend_status_text', 'service_specific_attribute', 'gateway_ip', 'gateway_mac', 'cidr')
+    inlines = (ProviderLinkInline, SubscriberLinkInline)
     form = VRouterTenantForm
 
-    suit_form_tabs = (('general', 'Details'),)
+    suit_form_tabs = (('general', 'Details'), ('servicelinks','Links'),)
 
     def get_queryset(self, request):
         return VRouterTenant.select_by_user(request.user)
diff --git a/xos/api/service/vrouter.py b/xos/api/service/vrouter.py
deleted file mode 100644
index a932931..0000000
--- a/xos/api/service/vrouter.py
+++ /dev/null
@@ -1,146 +0,0 @@
-from rest_framework.decorators import api_view
-from rest_framework.response import Response
-from rest_framework.reverse import reverse
-from rest_framework import serializers
-from rest_framework import generics
-from rest_framework import status
-from core.models import *
-from django.forms import widgets
-from services.vrouter.models import *
-from xos.apibase import XOSListCreateAPIView, XOSRetrieveUpdateDestroyAPIView, XOSPermissionDenied
-from api.xosapi_helpers import PlusModelSerializer, XOSViewSet, ReadOnlyField
-import json
-
-BASE_NAME = 'vrouter'
-
-
-class VRouterServiceSerializer(PlusModelSerializer):
-    id = ReadOnlyField()
-    name = serializers.CharField(required=False)
-    kind = serializers.CharField(required=False)
-    service_specific_attribute = serializers.CharField(required=False)
-    humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
-
-    class Meta:
-        model = VRouterService
-        fields = ('humanReadableName', 'id', 'name', 'kind', 'service_specific_attribute')
-
-    def getHumanReadableName(self, obj):
-        return obj.__unicode__()
-
-
-class VRouterDeviceSerializer(PlusModelSerializer):
-    id = ReadOnlyField()
-    name = serializers.CharField(required=False)
-    openflow_id = serializers.CharField(required=False)
-    config_key = serializers.CharField(required=False)
-    driver = serializers.CharField(required=False)
-    vrouter_service = serializers.PrimaryKeyRelatedField(read_only=True)
-
-    ports = serializers.SerializerMethodField("getDevicePorts")
-
-    def getDevicePorts(self, device):
-        ports = VRouterPort.objects.filter(vrouter_device=device.id)
-        return VRouterPortSerializer(ports, many=True).data
-
-    class Meta:
-        model = VRouterDevice
-        fields = ('id', 'name', 'openflow_id', 'config_key', 'driver', 'vrouter_service', 'ports')
-
-
-class VRouterPortSerializer(PlusModelSerializer):
-    id = ReadOnlyField()
-    name = serializers.CharField(required=False)
-    openflow_id = serializers.CharField(required=False)
-    interfaces = serializers.SerializerMethodField("getPortInterfaces")
-
-    def getPortInterfaces(self, port):
-        interfaces = VRouterInterface.objects.filter(vrouter_port=port.id)
-        return VRouterInterfaceSerializer(interfaces, many=True).data
-
-    class Meta:
-        model = VRouterPort
-        fields = ('id', 'name', 'openflow_id', 'interfaces')
-
-
-class VRouterInterfaceSerializer(PlusModelSerializer):
-    id = ReadOnlyField()
-    name = serializers.CharField(required=False)
-    mac = serializers.CharField(required=False)
-    vlan = serializers.CharField(required=False)
-    ips = serializers.SerializerMethodField("getInterfaceIps")
-
-    def getInterfaceIps(self, interface):
-        interfaces = VRouterIp.objects.filter(vrouter_interface=interface.id)
-        return VRouterIpSerializer(interfaces, many=True).data
-
-    class Meta:
-        model = VRouterPort
-        fields = ('id', 'name', 'mac', 'vlan', 'ips')
-
-
-class VRouterIpSerializer(PlusModelSerializer):
-    id = ReadOnlyField()
-    ip = serializers.CharField(required=False)
-    name = serializers.CharField(required=False)
-
-    class Meta:
-        model = VRouterIp
-        fields = ('id', 'ip', 'name')
-
-
-class VRouterAppSerializer(PlusModelSerializer):
-    id = ReadOnlyField()
-    name = serializers.CharField(required=False)
-    control_plane_connect_point = serializers.CharField(required=False)
-    ospf_enabled = serializers.BooleanField(required=False)
-    interfaces = serializers.SerializerMethodField("dumpInterfaces")
-
-    def dumpInterfaces(self, app):
-        return json.dumps(app.interfaces)
-
-    class Meta:
-        model = VRouterApp
-        fields = ('id', 'name', 'control_plane_connect_point', 'ospf_enabled', 'interfaces')
-
-
-class VRouterServiceViewSet(XOSViewSet):
-    base_name = BASE_NAME
-    method_name = "vrouter"
-    method_kind = "viewset"
-    queryset = VRouterService.objects.filter(kind='vROUTER')
-    serializer_class = VRouterServiceSerializer
-
-    @classmethod
-    def get_urlpatterns(self, api_path="^"):
-        patterns = super(VRouterServiceViewSet, self).get_urlpatterns(api_path=api_path)
-
-        patterns.append(self.detail_url("devices/$", {
-            "get": "get_devices"
-        }, "vrouter_devices"))
-
-        patterns.append(self.detail_url("apps/$", {
-            "get": "get_apps"
-        }, "vrouter_apps"))
-
-        return patterns
-
-    def get_devices(self, request, pk=None):
-        if (not request.user.is_authenticated()):
-            raise XOSPermissionDenied("You must be authenticated in order to use this API")
-        else:
-            if(pk is not None):
-                devices = VRouterDevice.objects.filter(vrouter_service=pk)
-            else:
-                devices = VRouterDevice.objects.all()
-            return Response(VRouterDeviceSerializer(devices, many=True).data)
-
-    def get_apps(self, request, pk=None):
-        if (not request.user.is_authenticated()):
-            raise XOSPermissionDenied("You must be authenticated in order to use this API")
-        else:
-            if(pk is not None):
-                apps = VRouterApp.objects.filter(vrouter_service=pk)
-            else:
-                apps = VRouterApp.objects.all()
-            return Response(VRouterAppSerializer(apps, many=True).data)
diff --git a/xos/models.py b/xos/models.py
index 906d125..32dd4f2 100644
--- a/xos/models.py
+++ b/xos/models.py
@@ -1,5 +1,5 @@
 from django.db import models
-from core.models import Service, XOSBase, Slice, Instance, Tenant, TenantWithContainer, Node, Image, User, Flavor, NetworkParameter, NetworkParameterType, Port, AddressPool
+from core.models import Service, XOSBase, Slice, Instance, ServiceInstance, Node, Image, User, Flavor, NetworkParameter, NetworkParameterType, Port, AddressPool
 from core.models.xosbase import StrippedCharField
 import os
 from django.db import models, transaction
@@ -22,40 +22,39 @@
         proxy = True
 
     def ip_to_mac(self, ip):
-	(a, b, c, d) = ip.split('.')
-	return "02:42:%02x:%02x:%02x:%02x" % (int(a), int(b), int(c), int(d))
+        (a, b, c, d) = ip.split('.')
+        return "02:42:%02x:%02x:%02x:%02x" % (int(a), int(b), int(c), int(d))
 
     def get_gateways(self):
-	gateways = []
+        gateways = []
+        aps = self.addresspools.all()
+        for ap in aps:
+            gateways.append({"gateway_ip": ap.gateway_ip, "gateway_mac": ap.gateway_mac})
 
-	aps = self.addresspools.all()
-	for ap in aps:
-	    gateways.append({"gateway_ip": ap.gateway_ip, "gateway_mac": ap.gateway_mac})
-
-	return gateways
+        return gateways
 
     def get_address_pool(self, name):
-	ap = AddressPool.objects.filter(name=name, service=self)
-	if not ap:
-	    raise Exception("vRouter unable to find addresspool %s" % name)
-	return ap[0]
+        ap = AddressPool.objects.filter(name=name, service=self)
+        if not ap:
+            raise Exception("vRouter unable to find addresspool %s" % name)
+        return ap[0]
 
     def get_tenant(self, **kwargs):
-	address_pool_name = kwargs.pop("address_pool_name")
+        address_pool_name = kwargs.pop("address_pool_name")
 
-	ap = self.get_address_pool(address_pool_name)
+        ap = self.get_address_pool(address_pool_name)
 
-	ip = ap.get_address()
-	if not ip:
-	    raise Exception("AddressPool '%s' has run out of addresses." % ap.name)
+        ip = ap.get_address()
+        if not ip:
+            raise Exception("AddressPool '%s' has run out of addresses." % ap.name)
 
-	t = VRouterTenant(provider_service=self, **kwargs)
-	t.public_ip = ip
-	t.public_mac = self.ip_to_mac(ip)
-	t.address_pool_id = ap.id
-	t.save()
+        t = VRouterTenant(owner=self, **kwargs)
+        t.public_ip = ip
+        t.public_mac = self.ip_to_mac(ip)
+        t.address_pool_id = ap.id
+        t.save()
 
-	return t
+        return t
 
 
 class VRouterDevice (VRouterDevice_decl):
diff --git a/xos/vrouter-onboard.yaml b/xos/vrouter-onboard.yaml
index 5e3c48b..c6d2562 100644
--- a/xos/vrouter-onboard.yaml
+++ b/xos/vrouter-onboard.yaml
@@ -18,6 +18,6 @@
           admin_template: templates/vrouteradmin.html
           tosca_custom_types: vrouter.yaml
           tosca_resource: tosca/resources/vrouterservice.py
-          rest_service: api/service/vrouter.py
+
 
 
diff --git a/xos/vrouter.xproto b/xos/vrouter.xproto
index 3a91d9d..47e2fe3 100644
--- a/xos/vrouter.xproto
+++ b/xos/vrouter.xproto
@@ -45,7 +45,7 @@
      required string ip = 3 [help_text = "interface ips", max_length = 19, null = False, db_index = False, blank = False];
 }
 
-message VRouterTenant (Tenant){
+message VRouterTenant (ServiceInstance){
      optional string public_ip = 1 [db_index = False, max_length = 30, null = True, content_type = "stripped", blank = True];
      optional string public_mac = 2 [db_index = False, max_length = 30, null = True, content_type = "stripped", blank = True];
      optional manytoone address_pool->AddressPool:vrouter_tenants = 3 [db_index = True, null = True, blank = True];
