diff --git a/xos/core/xoslib/methods/cordsubscriber.py b/xos/core/xoslib/methods/cordsubscriber.py
index f724c1e..1470323 100644
--- a/xos/core/xoslib/methods/cordsubscriber.py
+++ b/xos/core/xoslib/methods/cordsubscriber.py
@@ -12,16 +12,23 @@
 
 if hasattr(serializers, "ReadOnlyField"):
     # rest_framework 3.x
-    IdField = serializers.ReadOnlyField
+    ReadOnlyField = serializers.ReadOnlyField
 else:
     # rest_framework 2.x
-    IdField = serializers.Field
+    ReadOnlyField = serializers.Field
 
 class CordSubscriberIdSerializer(serializers.ModelSerializer, PlusSerializerMixin):
-        id = IdField()
-        vcpe_id = IdField()
-        sliver_id = IdField()
+        id = ReadOnlyField()
+        vcpe_id = ReadOnlyField()
+        sliver = ReadOnlyField()
+        image = ReadOnlyField()
         firewall_enable = serializers.BooleanField()
+        firewall_rules = serializers.CharField()
+        url_filter_enable = serializers.BooleanField()
+        url_filter_rules = serializers.CharField()
+        cdn_enable = serializers.BooleanField()
+        sliver_name = ReadOnlyField()
+        image_name = ReadOnlyField()
 
         humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
 
@@ -29,11 +36,11 @@
             model = CordSubscriber
             fields = ('humanReadableName', 'id',
                       'service_specific_id',
-                      'vcpe_id', 'sliver_id', 'firewall_enable')
+                      'vcpe_id', 'sliver', 'sliver_name', 'image', 'image_name', 'firewall_enable', 'firewall_rules', 'url_filter_enable', 'url_filter_rules', 'cdn_enable')
 
 
         def getHumanReadableName(self, obj):
-            return str(obj)
+            return obj.__unicode__()
 
 class CordSubscriberList(XOSListCreateAPIView):
     queryset = CordSubscriber.get_tenant_objects().select_related().all()
diff --git a/xos/core/xoslib/objects/cordsubscriber.py b/xos/core/xoslib/objects/cordsubscriber.py
index d483cac..654d8a3 100644
--- a/xos/core/xoslib/objects/cordsubscriber.py
+++ b/xos/core/xoslib/objects/cordsubscriber.py
@@ -4,6 +4,20 @@
 from operator import itemgetter, attrgetter
 from rest_framework.exceptions import APIException
 
+"""
+import os
+import sys
+sys.path.append("/opt/xos")
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
+import django
+from core.models import *
+from hpc.models import *
+from cord.models import *
+django.setup()
+from core.xoslib.objects.cordsubscriber import CordSubscriber
+c=CordSubscriber.get_tenant_objects().select_related().all()[0]
+"""
+
 class CordSubscriber(VOLTTenant, PlusObjectMixin):
     class Meta:
         proxy = True
@@ -22,29 +36,45 @@
     def vcpe_id(self, value):
         pass
 
-    @property
-    def sliver_id(self):
-        if self.vcpe and self.vcpe.sliver:
-            return self.vcpe.sliver.id
-        else:
-            return None
+    passthroughs = ( ("firewall_enable", "vcpe.firewall_enable"),
+                     ("firewall_rules", "vcpe.firewall_rules"),
+                     ("url_filter_enable", "vcpe.url_filter_enable"),
+                     ("url_filter_rules", "vcpe.url_filter_rules"),
+                     ("cdn_enable", "vcpe.cdn_enable"),
+                     ("image", "vcpe.image.id"),
+                     ("image_name", "vcpe.image.name"),
+                     ("sliver", "vcpe.sliver.id"),
+                     ("sliver_name", "vcpe.sliver.name") )
 
-    @sliver_id.setter
-    def sliver_id(self, value):
-        pass
+    def __getattr__(self, key):
+        for (member_name, passthrough_name) in self.passthroughs:
+            if key==member_name:
+                parts = passthrough_name.split(".")
+                obj = self
+                for part in parts[:-1]:
+                    obj = getattr(obj, part)
+                    if not obj:
+                        return None
+                return getattr(obj, parts[-1])
 
-    @property
-    def firewall_enable(self):
-        if self.vcpe:
-            return self.vcpe.firewall_enable
-        else:
-            return None
+        raise AttributeError("getattr: %r object has no attribute %r" %
+                         (self.__class__, key))
 
-    @firewall_enable.setter
-    def firewall_enable(self, value):
-        if self.vcpe:
-            self.vcpe.firewall_enable = value
-            # TODO: save it
+    def __setattr__(self, key, value):
+        for (member_name, passthrough_name) in self.passthroughs:
+            if key==member_name:
+                parts = passthrough_name.split(".")
+                obj = self
+                for part in parts[:-1]:
+                     obj = getattr(obj, part)
+                     if not obj:
+                         return
+                setattr(obj, parts[-1], value)
+
+        super(CordSubscriber, self).__setattr__(key, value)
+
+
+
 
 
 
