diff --git a/planetstack/apigen/api.template.py b/planetstack/apigen/api.template.py
index 710f051..b17f135 100644
--- a/planetstack/apigen/api.template.py
+++ b/planetstack/apigen/api.template.py
@@ -30,7 +30,6 @@
     {% for object in generator.all %}
         url(r'plstackapi/{{ object.rest_name }}/$', {{ object.camel }}List.as_view(), name='{{ object.singular }}-list'),
         url(r'plstackapi/{{ object.rest_name }}/(?P<pk>[a-zA-Z0-9\-]+)/$', {{ object.camel }}Detail.as_view(), name ='{{ object.singular }}-detail'),
-#        url(r'plstackapi/{{ object.rest_name }}/!new/$', {{ object.camel }}New.as_view(), name ='{{ object.singular }}-new'),
     {% endfor %}
     )
 
@@ -55,11 +54,17 @@
     {% endif %}
     {% endfor %}
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = {{ object.camel }}
-        fields = ('humanReadableName', {% for prop in object.props %}'{{ prop }}',{% endfor %}{% for ref in object.refs %}{%if ref.multi %}'{{ ref.plural }}'{% else %}'{{ ref }}'{% endif %},{% endfor %})
+        fields = ('humanReadableName', 'validators', {% for prop in object.props %}'{{ prop }}',{% endfor %}{% for ref in object.refs %}{%if ref.multi %}'{{ ref.plural }}'{% else %}'{{ ref }}'{% endif %},{% endfor %})
 
 class {{ object.camel }}IdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
@@ -71,11 +76,17 @@
     {% endif %}
     {% endfor %}
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = {{ object.camel }}
-        fields = ('humanReadableName', {% for prop in object.props %}'{{ prop }}',{% endfor %}{% for ref in object.refs %}{%if ref.multi %}'{{ ref.plural }}'{% else %}'{{ ref }}'{% endif %},{% endfor %})
+        fields = ('humanReadableName', 'validators', {% for prop in object.props %}'{{ prop }}',{% endfor %}{% for ref in object.refs %}{%if ref.multi %}'{{ ref.plural }}'{% else %}'{{ ref }}'{% endif %},{% endfor %})
 
 
 {% endfor %}
@@ -100,16 +111,20 @@
                                          files=request.FILES, partial=partial)
 
         if not serializer.is_valid():
-            print "UpdateModelMixin: not serializer.is_valid"
-            print serializer.errors
-            return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
 
         try:
             self.pre_save(serializer.object)
         except ValidationError as err:
             # full_clean on model instance may be called in pre_save,
             # so we have to handle eventual errors.
-            return Response(err.message_dict, status=status.HTTP_400_BAD_REQUEST)
+            response = {"error": "validation",
+                         "specific_error": "ValidationError in pre_save",
+                         "reasons": err.message_dict}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
 
         if serializer.object is not None:
             if not serializer.object.can_update(request.user):
@@ -155,7 +170,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -189,29 +207,4 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class {{ object.camel }}New(GenericAPIView):
-    serializer_class = {{ object.camel }}Serializer
-    id_serializer_class = {{ object.camel }}IdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = {{ object.camel }}()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 {% endfor %}
diff --git a/planetstack/genapi.py b/planetstack/genapi.py
index 5fba0c4..2510db9 100644
--- a/planetstack/genapi.py
+++ b/planetstack/genapi.py
@@ -30,199 +30,150 @@
     
         url(r'plstackapi/serviceattributes/$', ServiceAttributeList.as_view(), name='serviceattribute-list'),
         url(r'plstackapi/serviceattributes/(?P<pk>[a-zA-Z0-9\-]+)/$', ServiceAttributeDetail.as_view(), name ='serviceattribute-detail'),
-#        url(r'plstackapi/serviceattributes/!new/$', ServiceAttributeNew.as_view(), name ='serviceattribute-new'),
     
         url(r'plstackapi/images/$', ImageList.as_view(), name='image-list'),
         url(r'plstackapi/images/(?P<pk>[a-zA-Z0-9\-]+)/$', ImageDetail.as_view(), name ='image-detail'),
-#        url(r'plstackapi/images/!new/$', ImageNew.as_view(), name ='image-new'),
     
         url(r'plstackapi/networkparameters/$', NetworkParameterList.as_view(), name='networkparameter-list'),
         url(r'plstackapi/networkparameters/(?P<pk>[a-zA-Z0-9\-]+)/$', NetworkParameterDetail.as_view(), name ='networkparameter-detail'),
-#        url(r'plstackapi/networkparameters/!new/$', NetworkParameterNew.as_view(), name ='networkparameter-new'),
     
         url(r'plstackapi/sites/$', SiteList.as_view(), name='site-list'),
         url(r'plstackapi/sites/(?P<pk>[a-zA-Z0-9\-]+)/$', SiteDetail.as_view(), name ='site-detail'),
-#        url(r'plstackapi/sites/!new/$', SiteNew.as_view(), name ='site-new'),
     
         url(r'plstackapi/slice_roles/$', SliceRoleList.as_view(), name='slicerole-list'),
         url(r'plstackapi/slice_roles/(?P<pk>[a-zA-Z0-9\-]+)/$', SliceRoleDetail.as_view(), name ='slicerole-detail'),
-#        url(r'plstackapi/slice_roles/!new/$', SliceRoleNew.as_view(), name ='slicerole-new'),
     
         url(r'plstackapi/tags/$', TagList.as_view(), name='tag-list'),
         url(r'plstackapi/tags/(?P<pk>[a-zA-Z0-9\-]+)/$', TagDetail.as_view(), name ='tag-detail'),
-#        url(r'plstackapi/tags/!new/$', TagNew.as_view(), name ='tag-new'),
     
         url(r'plstackapi/invoices/$', InvoiceList.as_view(), name='invoice-list'),
         url(r'plstackapi/invoices/(?P<pk>[a-zA-Z0-9\-]+)/$', InvoiceDetail.as_view(), name ='invoice-detail'),
-#        url(r'plstackapi/invoices/!new/$', InvoiceNew.as_view(), name ='invoice-new'),
     
         url(r'plstackapi/slice_privileges/$', SlicePrivilegeList.as_view(), name='sliceprivilege-list'),
         url(r'plstackapi/slice_privileges/(?P<pk>[a-zA-Z0-9\-]+)/$', SlicePrivilegeDetail.as_view(), name ='sliceprivilege-detail'),
-#        url(r'plstackapi/slice_privileges/!new/$', SlicePrivilegeNew.as_view(), name ='sliceprivilege-new'),
     
         url(r'plstackapi/planetstackroles/$', PlanetStackRoleList.as_view(), name='planetstackrole-list'),
         url(r'plstackapi/planetstackroles/(?P<pk>[a-zA-Z0-9\-]+)/$', PlanetStackRoleDetail.as_view(), name ='planetstackrole-detail'),
-#        url(r'plstackapi/planetstackroles/!new/$', PlanetStackRoleNew.as_view(), name ='planetstackrole-new'),
     
         url(r'plstackapi/networkslivers/$', NetworkSliverList.as_view(), name='networksliver-list'),
         url(r'plstackapi/networkslivers/(?P<pk>[a-zA-Z0-9\-]+)/$', NetworkSliverDetail.as_view(), name ='networksliver-detail'),
-#        url(r'plstackapi/networkslivers/!new/$', NetworkSliverNew.as_view(), name ='networksliver-new'),
     
         url(r'plstackapi/networkdeployments/$', NetworkDeploymentsList.as_view(), name='networkdeployments-list'),
         url(r'plstackapi/networkdeployments/(?P<pk>[a-zA-Z0-9\-]+)/$', NetworkDeploymentsDetail.as_view(), name ='networkdeployments-detail'),
-#        url(r'plstackapi/networkdeployments/!new/$', NetworkDeploymentsNew.as_view(), name ='networkdeployments-new'),
     
         url(r'plstackapi/flavors/$', FlavorList.as_view(), name='flavor-list'),
         url(r'plstackapi/flavors/(?P<pk>[a-zA-Z0-9\-]+)/$', FlavorDetail.as_view(), name ='flavor-detail'),
-#        url(r'plstackapi/flavors/!new/$', FlavorNew.as_view(), name ='flavor-new'),
     
         url(r'plstackapi/projects/$', ProjectList.as_view(), name='project-list'),
         url(r'plstackapi/projects/(?P<pk>[a-zA-Z0-9\-]+)/$', ProjectDetail.as_view(), name ='project-detail'),
-#        url(r'plstackapi/projects/!new/$', ProjectNew.as_view(), name ='project-new'),
     
         url(r'plstackapi/slices/$', SliceList.as_view(), name='slice-list'),
         url(r'plstackapi/slices/(?P<pk>[a-zA-Z0-9\-]+)/$', SliceDetail.as_view(), name ='slice-detail'),
-#        url(r'plstackapi/slices/!new/$', SliceNew.as_view(), name ='slice-new'),
     
         url(r'plstackapi/networks/$', NetworkList.as_view(), name='network-list'),
         url(r'plstackapi/networks/(?P<pk>[a-zA-Z0-9\-]+)/$', NetworkDetail.as_view(), name ='network-detail'),
-#        url(r'plstackapi/networks/!new/$', NetworkNew.as_view(), name ='network-new'),
     
         url(r'plstackapi/services/$', ServiceList.as_view(), name='service-list'),
         url(r'plstackapi/services/(?P<pk>[a-zA-Z0-9\-]+)/$', ServiceDetail.as_view(), name ='service-detail'),
-#        url(r'plstackapi/services/!new/$', ServiceNew.as_view(), name ='service-new'),
     
         url(r'plstackapi/serviceclasses/$', ServiceClassList.as_view(), name='serviceclass-list'),
         url(r'plstackapi/serviceclasses/(?P<pk>[a-zA-Z0-9\-]+)/$', ServiceClassDetail.as_view(), name ='serviceclass-detail'),
-#        url(r'plstackapi/serviceclasses/!new/$', ServiceClassNew.as_view(), name ='serviceclass-new'),
     
         url(r'plstackapi/payments/$', PaymentList.as_view(), name='payment-list'),
         url(r'plstackapi/payments/(?P<pk>[a-zA-Z0-9\-]+)/$', PaymentDetail.as_view(), name ='payment-detail'),
-#        url(r'plstackapi/payments/!new/$', PaymentNew.as_view(), name ='payment-new'),
     
         url(r'plstackapi/charges/$', ChargeList.as_view(), name='charge-list'),
         url(r'plstackapi/charges/(?P<pk>[a-zA-Z0-9\-]+)/$', ChargeDetail.as_view(), name ='charge-detail'),
-#        url(r'plstackapi/charges/!new/$', ChargeNew.as_view(), name ='charge-new'),
     
         url(r'plstackapi/roles/$', RoleList.as_view(), name='role-list'),
         url(r'plstackapi/roles/(?P<pk>[a-zA-Z0-9\-]+)/$', RoleDetail.as_view(), name ='role-detail'),
-#        url(r'plstackapi/roles/!new/$', RoleNew.as_view(), name ='role-new'),
     
         url(r'plstackapi/usableobjects/$', UsableObjectList.as_view(), name='usableobject-list'),
         url(r'plstackapi/usableobjects/(?P<pk>[a-zA-Z0-9\-]+)/$', UsableObjectDetail.as_view(), name ='usableobject-detail'),
-#        url(r'plstackapi/usableobjects/!new/$', UsableObjectNew.as_view(), name ='usableobject-new'),
     
         url(r'plstackapi/site_roles/$', SiteRoleList.as_view(), name='siterole-list'),
         url(r'plstackapi/site_roles/(?P<pk>[a-zA-Z0-9\-]+)/$', SiteRoleDetail.as_view(), name ='siterole-detail'),
-#        url(r'plstackapi/site_roles/!new/$', SiteRoleNew.as_view(), name ='siterole-new'),
     
         url(r'plstackapi/slicecredentials/$', SliceCredentialList.as_view(), name='slicecredential-list'),
         url(r'plstackapi/slicecredentials/(?P<pk>[a-zA-Z0-9\-]+)/$', SliceCredentialDetail.as_view(), name ='slicecredential-detail'),
-#        url(r'plstackapi/slicecredentials/!new/$', SliceCredentialNew.as_view(), name ='slicecredential-new'),
     
         url(r'plstackapi/slivers/$', SliverList.as_view(), name='sliver-list'),
         url(r'plstackapi/slivers/(?P<pk>[a-zA-Z0-9\-]+)/$', SliverDetail.as_view(), name ='sliver-detail'),
-#        url(r'plstackapi/slivers/!new/$', SliverNew.as_view(), name ='sliver-new'),
     
         url(r'plstackapi/nodes/$', NodeList.as_view(), name='node-list'),
         url(r'plstackapi/nodes/(?P<pk>[a-zA-Z0-9\-]+)/$', NodeDetail.as_view(), name ='node-detail'),
-#        url(r'plstackapi/nodes/!new/$', NodeNew.as_view(), name ='node-new'),
     
         url(r'plstackapi/dashboardviews/$', DashboardViewList.as_view(), name='dashboardview-list'),
         url(r'plstackapi/dashboardviews/(?P<pk>[a-zA-Z0-9\-]+)/$', DashboardViewDetail.as_view(), name ='dashboardview-detail'),
-#        url(r'plstackapi/dashboardviews/!new/$', DashboardViewNew.as_view(), name ='dashboardview-new'),
     
         url(r'plstackapi/imagedeployments/$', ImageDeploymentsList.as_view(), name='imagedeployments-list'),
         url(r'plstackapi/imagedeployments/(?P<pk>[a-zA-Z0-9\-]+)/$', ImageDeploymentsDetail.as_view(), name ='imagedeployments-detail'),
-#        url(r'plstackapi/imagedeployments/!new/$', ImageDeploymentsNew.as_view(), name ='imagedeployments-new'),
     
         url(r'plstackapi/reservedresources/$', ReservedResourceList.as_view(), name='reservedresource-list'),
         url(r'plstackapi/reservedresources/(?P<pk>[a-zA-Z0-9\-]+)/$', ReservedResourceDetail.as_view(), name ='reservedresource-detail'),
-#        url(r'plstackapi/reservedresources/!new/$', ReservedResourceNew.as_view(), name ='reservedresource-new'),
     
         url(r'plstackapi/networkslices/$', NetworkSliceList.as_view(), name='networkslice-list'),
         url(r'plstackapi/networkslices/(?P<pk>[a-zA-Z0-9\-]+)/$', NetworkSliceDetail.as_view(), name ='networkslice-detail'),
-#        url(r'plstackapi/networkslices/!new/$', NetworkSliceNew.as_view(), name ='networkslice-new'),
     
         url(r'plstackapi/userdashboardviews/$', UserDashboardViewList.as_view(), name='userdashboardview-list'),
         url(r'plstackapi/userdashboardviews/(?P<pk>[a-zA-Z0-9\-]+)/$', UserDashboardViewDetail.as_view(), name ='userdashboardview-detail'),
-#        url(r'plstackapi/userdashboardviews/!new/$', UserDashboardViewNew.as_view(), name ='userdashboardview-new'),
     
         url(r'plstackapi/planetstackprivileges/$', PlanetStackPrivilegeList.as_view(), name='planetstackprivilege-list'),
         url(r'plstackapi/planetstackprivileges/(?P<pk>[a-zA-Z0-9\-]+)/$', PlanetStackPrivilegeDetail.as_view(), name ='planetstackprivilege-detail'),
-#        url(r'plstackapi/planetstackprivileges/!new/$', PlanetStackPrivilegeNew.as_view(), name ='planetstackprivilege-new'),
     
         url(r'plstackapi/users/$', UserList.as_view(), name='user-list'),
         url(r'plstackapi/users/(?P<pk>[a-zA-Z0-9\-]+)/$', UserDetail.as_view(), name ='user-detail'),
-#        url(r'plstackapi/users/!new/$', UserNew.as_view(), name ='user-new'),
     
         url(r'plstackapi/deployments/$', DeploymentList.as_view(), name='deployment-list'),
         url(r'plstackapi/deployments/(?P<pk>[a-zA-Z0-9\-]+)/$', DeploymentDetail.as_view(), name ='deployment-detail'),
-#        url(r'plstackapi/deployments/!new/$', DeploymentNew.as_view(), name ='deployment-new'),
     
         url(r'plstackapi/reservations/$', ReservationList.as_view(), name='reservation-list'),
         url(r'plstackapi/reservations/(?P<pk>[a-zA-Z0-9\-]+)/$', ReservationDetail.as_view(), name ='reservation-detail'),
-#        url(r'plstackapi/reservations/!new/$', ReservationNew.as_view(), name ='reservation-new'),
     
         url(r'plstackapi/slicedeployments/$', SliceDeploymentsList.as_view(), name='slicedeployments-list'),
         url(r'plstackapi/slicedeployments/(?P<pk>[a-zA-Z0-9\-]+)/$', SliceDeploymentsDetail.as_view(), name ='slicedeployments-detail'),
-#        url(r'plstackapi/slicedeployments/!new/$', SliceDeploymentsNew.as_view(), name ='slicedeployments-new'),
     
         url(r'plstackapi/siteprivileges/$', SitePrivilegeList.as_view(), name='siteprivilege-list'),
         url(r'plstackapi/siteprivileges/(?P<pk>[a-zA-Z0-9\-]+)/$', SitePrivilegeDetail.as_view(), name ='siteprivilege-detail'),
-#        url(r'plstackapi/siteprivileges/!new/$', SitePrivilegeNew.as_view(), name ='siteprivilege-new'),
     
         url(r'plstackapi/planetstacks/$', PlanetStackList.as_view(), name='planetstack-list'),
         url(r'plstackapi/planetstacks/(?P<pk>[a-zA-Z0-9\-]+)/$', PlanetStackDetail.as_view(), name ='planetstack-detail'),
-#        url(r'plstackapi/planetstacks/!new/$', PlanetStackNew.as_view(), name ='planetstack-new'),
     
         url(r'plstackapi/userdeployments/$', UserDeploymentsList.as_view(), name='userdeployments-list'),
         url(r'plstackapi/userdeployments/(?P<pk>[a-zA-Z0-9\-]+)/$', UserDeploymentsDetail.as_view(), name ='userdeployments-detail'),
-#        url(r'plstackapi/userdeployments/!new/$', UserDeploymentsNew.as_view(), name ='userdeployments-new'),
     
         url(r'plstackapi/accounts/$', AccountList.as_view(), name='account-list'),
         url(r'plstackapi/accounts/(?P<pk>[a-zA-Z0-9\-]+)/$', AccountDetail.as_view(), name ='account-detail'),
-#        url(r'plstackapi/accounts/!new/$', AccountNew.as_view(), name ='account-new'),
     
         url(r'plstackapi/networkparametertypes/$', NetworkParameterTypeList.as_view(), name='networkparametertype-list'),
         url(r'plstackapi/networkparametertypes/(?P<pk>[a-zA-Z0-9\-]+)/$', NetworkParameterTypeDetail.as_view(), name ='networkparametertype-detail'),
-#        url(r'plstackapi/networkparametertypes/!new/$', NetworkParameterTypeNew.as_view(), name ='networkparametertype-new'),
     
         url(r'plstackapi/sitecredentials/$', SiteCredentialList.as_view(), name='sitecredential-list'),
         url(r'plstackapi/sitecredentials/(?P<pk>[a-zA-Z0-9\-]+)/$', SiteCredentialDetail.as_view(), name ='sitecredential-detail'),
-#        url(r'plstackapi/sitecredentials/!new/$', SiteCredentialNew.as_view(), name ='sitecredential-new'),
     
         url(r'plstackapi/deploymentprivileges/$', DeploymentPrivilegeList.as_view(), name='deploymentprivilege-list'),
         url(r'plstackapi/deploymentprivileges/(?P<pk>[a-zA-Z0-9\-]+)/$', DeploymentPrivilegeDetail.as_view(), name ='deploymentprivilege-detail'),
-#        url(r'plstackapi/deploymentprivileges/!new/$', DeploymentPrivilegeNew.as_view(), name ='deploymentprivilege-new'),
     
         url(r'plstackapi/deploymentroles/$', DeploymentRoleList.as_view(), name='deploymentrole-list'),
         url(r'plstackapi/deploymentroles/(?P<pk>[a-zA-Z0-9\-]+)/$', DeploymentRoleDetail.as_view(), name ='deploymentrole-detail'),
-#        url(r'plstackapi/deploymentroles/!new/$', DeploymentRoleNew.as_view(), name ='deploymentrole-new'),
     
         url(r'plstackapi/usercredentials/$', UserCredentialList.as_view(), name='usercredential-list'),
         url(r'plstackapi/usercredentials/(?P<pk>[a-zA-Z0-9\-]+)/$', UserCredentialDetail.as_view(), name ='usercredential-detail'),
-#        url(r'plstackapi/usercredentials/!new/$', UserCredentialNew.as_view(), name ='usercredential-new'),
     
         url(r'plstackapi/sitedeployments/$', SiteDeploymentsList.as_view(), name='sitedeployments-list'),
         url(r'plstackapi/sitedeployments/(?P<pk>[a-zA-Z0-9\-]+)/$', SiteDeploymentsDetail.as_view(), name ='sitedeployments-detail'),
-#        url(r'plstackapi/sitedeployments/!new/$', SiteDeploymentsNew.as_view(), name ='sitedeployments-new'),
     
         url(r'plstackapi/slicetags/$', SliceTagList.as_view(), name='slicetag-list'),
         url(r'plstackapi/slicetags/(?P<pk>[a-zA-Z0-9\-]+)/$', SliceTagDetail.as_view(), name ='slicetag-detail'),
-#        url(r'plstackapi/slicetags/!new/$', SliceTagNew.as_view(), name ='slicetag-new'),
     
         url(r'plstackapi/networktemplates/$', NetworkTemplateList.as_view(), name='networktemplate-list'),
         url(r'plstackapi/networktemplates/(?P<pk>[a-zA-Z0-9\-]+)/$', NetworkTemplateDetail.as_view(), name ='networktemplate-detail'),
-#        url(r'plstackapi/networktemplates/!new/$', NetworkTemplateNew.as_view(), name ='networktemplate-new'),
     
         url(r'plstackapi/routers/$', RouterList.as_view(), name='router-list'),
         url(r'plstackapi/routers/(?P<pk>[a-zA-Z0-9\-]+)/$', RouterDetail.as_view(), name ='router-detail'),
-#        url(r'plstackapi/routers/!new/$', RouterNew.as_view(), name ='router-new'),
     
         url(r'plstackapi/serviceresources/$', ServiceResourceList.as_view(), name='serviceresource-list'),
         url(r'plstackapi/serviceresources/(?P<pk>[a-zA-Z0-9\-]+)/$', ServiceResourceDetail.as_view(), name ='serviceresource-detail'),
-#        url(r'plstackapi/serviceresources/!new/$', ServiceResourceNew.as_view(), name ='serviceresource-new'),
     
     )
 
@@ -289,21 +240,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = ServiceAttribute
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name','value','service',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name','value','service',)
 
 class ServiceAttributeIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = ServiceAttribute
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name','value','service',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name','value','service',)
 
 
 
@@ -312,21 +275,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Image
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name','disk_format','container_format','path',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name','disk_format','container_format','path',)
 
 class ImageIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Image
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name','disk_format','container_format','path',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name','disk_format','container_format','path',)
 
 
 
@@ -335,21 +310,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = NetworkParameter
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','parameter','value','content_type','object_id',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','parameter','value','content_type','object_id',)
 
 class NetworkParameterIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = NetworkParameter
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','parameter','value','content_type','object_id',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','parameter','value','content_type','object_id',)
 
 
 
@@ -358,21 +345,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Site
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name','site_url','enabled','location','longitude','latitude','login_base','is_public','abbreviated_name',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name','site_url','enabled','location','longitude','latitude','login_base','is_public','abbreviated_name',)
 
 class SiteIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Site
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name','site_url','enabled','location','longitude','latitude','login_base','is_public','abbreviated_name',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name','site_url','enabled','location','longitude','latitude','login_base','is_public','abbreviated_name',)
 
 
 
@@ -381,21 +380,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = SliceRole
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','role',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','role',)
 
 class SliceRoleIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = SliceRole
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','role',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','role',)
 
 
 
@@ -404,21 +415,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Tag
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','service','name','value','content_type','object_id',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','service','name','value','content_type','object_id',)
 
 class TagIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Tag
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','service','name','value','content_type','object_id',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','service','name','value','content_type','object_id',)
 
 
 
@@ -427,21 +450,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Invoice
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','date','account',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','date','account',)
 
 class InvoiceIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Invoice
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','date','account',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','date','account',)
 
 
 
@@ -450,21 +485,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = SlicePrivilege
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','user','slice','role',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','user','slice','role',)
 
 class SlicePrivilegeIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = SlicePrivilege
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','user','slice','role',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','user','slice','role',)
 
 
 
@@ -473,21 +520,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = PlanetStackRole
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','role',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','role',)
 
 class PlanetStackRoleIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = PlanetStackRole
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','role',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','role',)
 
 
 
@@ -496,21 +555,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = NetworkSliver
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','network','sliver','ip','port_id',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','network','sliver','ip','port_id',)
 
 class NetworkSliverIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = NetworkSliver
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','network','sliver','ip','port_id',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','network','sliver','ip','port_id',)
 
 
 
@@ -519,21 +590,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = NetworkDeployments
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','network','deployment','net_id','router_id','subnet_id','subnet',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','network','deployment','net_id','router_id','subnet_id','subnet',)
 
 class NetworkDeploymentsIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = NetworkDeployments
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','network','deployment','net_id','router_id','subnet_id','subnet',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','network','deployment','net_id','router_id','subnet_id','subnet',)
 
 
 
@@ -542,21 +625,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Flavor
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name','description','flavor','order','default',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name','description','flavor','order','default',)
 
 class FlavorIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Flavor
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name','description','flavor','order','default',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name','description','flavor','order','default',)
 
 
 
@@ -565,21 +660,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Project
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name',)
 
 class ProjectIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Project
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name',)
 
 
 
@@ -604,11 +711,17 @@
     
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Slice
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name','enabled','omf_friendly','description','slice_url','site','max_slivers','imagePreference','service','network','mountDataSets','serviceClass','creator','networks','availableNetworks','networks','networks',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name','enabled','omf_friendly','description','slice_url','site','max_slivers','imagePreference','service','network','mountDataSets','serviceClass','creator','networks','availableNetworks','networks','networks',)
 
 class SliceIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
@@ -630,11 +743,17 @@
     
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Slice
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name','enabled','omf_friendly','description','slice_url','site','max_slivers','imagePreference','service','network','mountDataSets','serviceClass','creator','networks','availableNetworks','networks','networks',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name','enabled','omf_friendly','description','slice_url','site','max_slivers','imagePreference','service','network','mountDataSets','serviceClass','creator','networks','availableNetworks','networks','networks',)
 
 
 
@@ -659,11 +778,17 @@
     
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Network
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name','template','subnet','ports','labels','owner','guaranteedBandwidth','permitAllSlices','topologyParameters','controllerUrl','controllerParameters','network_id','router_id','subnet_id','routers','availableRouters','routers','routers',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name','template','subnet','ports','labels','owner','guaranteedBandwidth','permitAllSlices','topologyParameters','controllerUrl','controllerParameters','network_id','router_id','subnet_id','routers','availableRouters','routers','routers',)
 
 class NetworkIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
@@ -685,11 +810,17 @@
     
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Network
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name','template','subnet','ports','labels','owner','guaranteedBandwidth','permitAllSlices','topologyParameters','controllerUrl','controllerParameters','network_id','router_id','subnet_id','routers','availableRouters','routers','routers',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name','template','subnet','ports','labels','owner','guaranteedBandwidth','permitAllSlices','topologyParameters','controllerUrl','controllerParameters','network_id','router_id','subnet_id','routers','availableRouters','routers','routers',)
 
 
 
@@ -698,21 +829,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Service
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','description','enabled','name','versionNumber','published',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','description','enabled','name','versionNumber','published',)
 
 class ServiceIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Service
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','description','enabled','name','versionNumber','published',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','description','enabled','name','versionNumber','published',)
 
 
 
@@ -721,21 +864,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = ServiceClass
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name','description','commitment','membershipFee','membershipFeeMonths','upgradeRequiresApproval',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name','description','commitment','membershipFee','membershipFeeMonths','upgradeRequiresApproval',)
 
 class ServiceClassIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = ServiceClass
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name','description','commitment','membershipFee','membershipFeeMonths','upgradeRequiresApproval',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name','description','commitment','membershipFee','membershipFeeMonths','upgradeRequiresApproval',)
 
 
 
@@ -744,21 +899,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Payment
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','account','amount','date',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','account','amount','date',)
 
 class PaymentIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Payment
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','account','amount','date',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','account','amount','date',)
 
 
 
@@ -767,21 +934,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Charge
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','account','slice','kind','state','date','object','amount','coreHours','invoice',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','account','slice','kind','state','date','object','amount','coreHours','invoice',)
 
 class ChargeIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Charge
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','account','slice','kind','state','date','object','amount','coreHours','invoice',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','account','slice','kind','state','date','object','amount','coreHours','invoice',)
 
 
 
@@ -790,21 +969,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Role
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','role_type','role','description','content_type',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','role_type','role','description','content_type',)
 
 class RoleIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Role
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','role_type','role','description','content_type',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','role_type','role','description','content_type',)
 
 
 
@@ -813,21 +1004,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = UsableObject
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name',)
 
 class UsableObjectIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = UsableObject
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name',)
 
 
 
@@ -836,21 +1039,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = SiteRole
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','role',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','role',)
 
 class SiteRoleIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = SiteRole
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','role',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','role',)
 
 
 
@@ -859,21 +1074,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = SliceCredential
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','slice','name','key_id','enc_value',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','slice','name','key_id','enc_value',)
 
 class SliceCredentialIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = SliceCredential
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','slice','name','key_id','enc_value',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','slice','name','key_id','enc_value',)
 
 
 
@@ -890,11 +1117,17 @@
     
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Sliver
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','instance_id','name','instance_name','ip','image','creator','slice','node','deploymentNetwork','numberCores','flavor','userData','networks','networks',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','instance_id','name','instance_name','ip','image','creator','slice','node','deploymentNetwork','numberCores','flavor','userData','networks','networks',)
 
 class SliverIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
@@ -908,11 +1141,17 @@
     
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Sliver
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','instance_id','name','instance_name','ip','image','creator','slice','node','deploymentNetwork','numberCores','flavor','userData','networks','networks',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','instance_id','name','instance_name','ip','image','creator','slice','node','deploymentNetwork','numberCores','flavor','userData','networks','networks',)
 
 
 
@@ -921,21 +1160,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Node
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name','site','deployment',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name','site','deployment',)
 
 class NodeIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Node
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name','site','deployment',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name','site','deployment',)
 
 
 
@@ -944,21 +1195,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = DashboardView
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name','url',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name','url',)
 
 class DashboardViewIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = DashboardView
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name','url',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name','url',)
 
 
 
@@ -967,21 +1230,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = ImageDeployments
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','image','deployment','glance_image_id',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','image','deployment','glance_image_id',)
 
 class ImageDeploymentsIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = ImageDeployments
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','image','deployment','glance_image_id',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','image','deployment','glance_image_id',)
 
 
 
@@ -990,21 +1265,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = ReservedResource
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','sliver','resource','quantity','reservationSet',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','sliver','resource','quantity','reservationSet',)
 
 class ReservedResourceIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = ReservedResource
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','sliver','resource','quantity','reservationSet',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','sliver','resource','quantity','reservationSet',)
 
 
 
@@ -1013,21 +1300,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = NetworkSlice
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','network','slice',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','network','slice',)
 
 class NetworkSliceIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = NetworkSlice
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','network','slice',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','network','slice',)
 
 
 
@@ -1036,21 +1335,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = UserDashboardView
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','user','dashboardView','order',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','user','dashboardView','order',)
 
 class UserDashboardViewIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = UserDashboardView
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','user','dashboardView','order',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','user','dashboardView','order',)
 
 
 
@@ -1059,21 +1370,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = PlanetStackPrivilege
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','user','planetstack','role',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','user','planetstack','role',)
 
 class PlanetStackPrivilegeIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = PlanetStackPrivilege
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','user','planetstack','role',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','user','planetstack','role',)
 
 
 
@@ -1082,21 +1405,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = User
-        fields = ('humanReadableName', 'id','password','last_login','email','username','firstname','lastname','phone','user_url','site','public_key','is_active','is_admin','is_staff','is_readonly','created','updated','enacted','backend_status','deleted','timezone',)
+        fields = ('humanReadableName', 'validators', 'id','password','last_login','email','username','firstname','lastname','phone','user_url','site','public_key','is_active','is_admin','is_staff','is_readonly','created','updated','enacted','backend_status','deleted','timezone',)
 
 class UserIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = User
-        fields = ('humanReadableName', 'id','password','last_login','email','username','firstname','lastname','phone','user_url','site','public_key','is_active','is_admin','is_staff','is_readonly','created','updated','enacted','backend_status','deleted','timezone',)
+        fields = ('humanReadableName', 'validators', 'id','password','last_login','email','username','firstname','lastname','phone','user_url','site','public_key','is_active','is_admin','is_staff','is_readonly','created','updated','enacted','backend_status','deleted','timezone',)
 
 
 
@@ -1121,11 +1456,17 @@
     
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Deployment
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name','admin_user','admin_password','admin_tenant','auth_url','backend_type','availability_zone','accessControl','sites','sites','flavors','flavors',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name','admin_user','admin_password','admin_tenant','auth_url','backend_type','availability_zone','accessControl','sites','sites','flavors','flavors',)
 
 class DeploymentIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
@@ -1147,11 +1488,17 @@
     
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Deployment
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name','admin_user','admin_password','admin_tenant','auth_url','backend_type','availability_zone','accessControl','sites','sites','flavors','flavors',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name','admin_user','admin_password','admin_tenant','auth_url','backend_type','availability_zone','accessControl','sites','sites','flavors','flavors',)
 
 
 
@@ -1160,21 +1507,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Reservation
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','startTime','slice','duration',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','startTime','slice','duration',)
 
 class ReservationIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Reservation
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','startTime','slice','duration',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','startTime','slice','duration',)
 
 
 
@@ -1183,21 +1542,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = SliceDeployments
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','slice','deployment','tenant_id','network_id','router_id','subnet_id',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','slice','deployment','tenant_id','network_id','router_id','subnet_id',)
 
 class SliceDeploymentsIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = SliceDeployments
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','slice','deployment','tenant_id','network_id','router_id','subnet_id',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','slice','deployment','tenant_id','network_id','router_id','subnet_id',)
 
 
 
@@ -1206,21 +1577,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = SitePrivilege
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','user','site','role',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','user','site','role',)
 
 class SitePrivilegeIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = SitePrivilege
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','user','site','role',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','user','site','role',)
 
 
 
@@ -1229,21 +1612,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = PlanetStack
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','description',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','description',)
 
 class PlanetStackIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = PlanetStack
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','description',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','description',)
 
 
 
@@ -1252,21 +1647,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = UserDeployments
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','user','deployment','kuser_id',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','user','deployment','kuser_id',)
 
 class UserDeploymentsIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = UserDeployments
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','user','deployment','kuser_id',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','user','deployment','kuser_id',)
 
 
 
@@ -1275,21 +1682,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Account
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','site',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','site',)
 
 class AccountIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Account
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','site',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','site',)
 
 
 
@@ -1298,21 +1717,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = NetworkParameterType
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name','description',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name','description',)
 
 class NetworkParameterTypeIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = NetworkParameterType
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name','description',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name','description',)
 
 
 
@@ -1321,21 +1752,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = SiteCredential
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','site','name','key_id','enc_value',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','site','name','key_id','enc_value',)
 
 class SiteCredentialIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = SiteCredential
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','site','name','key_id','enc_value',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','site','name','key_id','enc_value',)
 
 
 
@@ -1344,21 +1787,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = DeploymentPrivilege
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','user','deployment','role',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','user','deployment','role',)
 
 class DeploymentPrivilegeIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = DeploymentPrivilege
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','user','deployment','role',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','user','deployment','role',)
 
 
 
@@ -1367,21 +1822,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = DeploymentRole
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','role',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','role',)
 
 class DeploymentRoleIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = DeploymentRole
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','role',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','role',)
 
 
 
@@ -1390,21 +1857,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = UserCredential
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','user','name','key_id','enc_value',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','user','name','key_id','enc_value',)
 
 class UserCredentialIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = UserCredential
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','user','name','key_id','enc_value',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','user','name','key_id','enc_value',)
 
 
 
@@ -1413,21 +1892,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = SiteDeployments
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','site','deployment','tenant_id',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','site','deployment','tenant_id',)
 
 class SiteDeploymentsIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = SiteDeployments
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','site','deployment','tenant_id',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','site','deployment','tenant_id',)
 
 
 
@@ -1436,21 +1927,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = SliceTag
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','slice','name','value',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','slice','name','value',)
 
 class SliceTagIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = SliceTag
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','slice','name','value',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','slice','name','value',)
 
 
 
@@ -1459,21 +1962,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = NetworkTemplate
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name','description','guaranteedBandwidth','visibility','translation','sharedNetworkName','sharedNetworkId','topologyKind','controllerKind',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name','description','guaranteedBandwidth','visibility','translation','sharedNetworkName','sharedNetworkId','topologyKind','controllerKind',)
 
 class NetworkTemplateIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = NetworkTemplate
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name','description','guaranteedBandwidth','visibility','translation','sharedNetworkName','sharedNetworkId','topologyKind','controllerKind',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name','description','guaranteedBandwidth','visibility','translation','sharedNetworkName','sharedNetworkId','topologyKind','controllerKind',)
 
 
 
@@ -1482,21 +1997,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Router
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name','owner',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name','owner',)
 
 class RouterIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = Router
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','name','owner',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','name','owner',)
 
 
 
@@ -1505,21 +2032,33 @@
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = ServiceResource
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','serviceClass','name','maxUnitsDeployment','maxUnitsNode','maxDuration','bucketInRate','bucketMaxSize','cost','calendarReservable',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','serviceClass','name','maxUnitsDeployment','maxUnitsNode','maxDuration','bucketInRate','bucketMaxSize','cost','calendarReservable',)
 
 class ServiceResourceIdSerializer(serializers.ModelSerializer):
     id = serializers.Field()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    validators = serializers.SerializerMethodField("getValidators")
     def getHumanReadableName(self, obj):
         return str(obj)
+    def getValidators(self, obj):
+        try:
+            return obj.getValidators()
+        except:
+            return None
     class Meta:
         model = ServiceResource
-        fields = ('humanReadableName', 'id','created','updated','enacted','backend_status','deleted','serviceClass','name','maxUnitsDeployment','maxUnitsNode','maxDuration','bucketInRate','bucketMaxSize','cost','calendarReservable',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','backend_status','deleted','serviceClass','name','maxUnitsDeployment','maxUnitsNode','maxDuration','bucketInRate','bucketMaxSize','cost','calendarReservable',)
 
 
 
@@ -1640,16 +2179,20 @@
                                          files=request.FILES, partial=partial)
 
         if not serializer.is_valid():
-            print "UpdateModelMixin: not serializer.is_valid"
-            print serializer.errors
-            return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
 
         try:
             self.pre_save(serializer.object)
         except ValidationError as err:
             # full_clean on model instance may be called in pre_save,
             # so we have to handle eventual errors.
-            return Response(err.message_dict, status=status.HTTP_400_BAD_REQUEST)
+            response = {"error": "validation",
+                         "specific_error": "ValidationError in pre_save",
+                         "reasons": err.message_dict}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
 
         if serializer.object is not None:
             if not serializer.object.can_update(request.user):
@@ -1695,7 +2238,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -1729,31 +2275,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class ServiceAttributeNew(GenericAPIView):
-    serializer_class = ServiceAttributeSerializer
-    id_serializer_class = ServiceAttributeIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = ServiceAttribute()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class ImageList(generics.ListCreateAPIView):
@@ -1776,7 +2297,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -1810,31 +2334,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class ImageNew(GenericAPIView):
-    serializer_class = ImageSerializer
-    id_serializer_class = ImageIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = Image()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class NetworkParameterList(generics.ListCreateAPIView):
@@ -1857,7 +2356,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -1891,31 +2393,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class NetworkParameterNew(GenericAPIView):
-    serializer_class = NetworkParameterSerializer
-    id_serializer_class = NetworkParameterIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = NetworkParameter()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class SiteList(generics.ListCreateAPIView):
@@ -1938,7 +2415,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -1972,31 +2452,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class SiteNew(GenericAPIView):
-    serializer_class = SiteSerializer
-    id_serializer_class = SiteIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = Site()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class SliceRoleList(generics.ListCreateAPIView):
@@ -2019,7 +2474,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -2053,31 +2511,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class SliceRoleNew(GenericAPIView):
-    serializer_class = SliceRoleSerializer
-    id_serializer_class = SliceRoleIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = SliceRole()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class TagList(generics.ListCreateAPIView):
@@ -2100,7 +2533,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -2134,31 +2570,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class TagNew(GenericAPIView):
-    serializer_class = TagSerializer
-    id_serializer_class = TagIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = Tag()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class InvoiceList(generics.ListCreateAPIView):
@@ -2181,7 +2592,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -2215,31 +2629,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class InvoiceNew(GenericAPIView):
-    serializer_class = InvoiceSerializer
-    id_serializer_class = InvoiceIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = Invoice()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class SlicePrivilegeList(generics.ListCreateAPIView):
@@ -2262,7 +2651,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -2296,31 +2688,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class SlicePrivilegeNew(GenericAPIView):
-    serializer_class = SlicePrivilegeSerializer
-    id_serializer_class = SlicePrivilegeIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = SlicePrivilege()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class PlanetStackRoleList(generics.ListCreateAPIView):
@@ -2343,7 +2710,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -2377,31 +2747,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class PlanetStackRoleNew(GenericAPIView):
-    serializer_class = PlanetStackRoleSerializer
-    id_serializer_class = PlanetStackRoleIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = PlanetStackRole()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class NetworkSliverList(generics.ListCreateAPIView):
@@ -2424,7 +2769,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -2458,31 +2806,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class NetworkSliverNew(GenericAPIView):
-    serializer_class = NetworkSliverSerializer
-    id_serializer_class = NetworkSliverIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = NetworkSliver()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class NetworkDeploymentsList(generics.ListCreateAPIView):
@@ -2505,7 +2828,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -2539,31 +2865,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class NetworkDeploymentsNew(GenericAPIView):
-    serializer_class = NetworkDeploymentsSerializer
-    id_serializer_class = NetworkDeploymentsIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = NetworkDeployments()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class FlavorList(generics.ListCreateAPIView):
@@ -2586,7 +2887,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -2620,31 +2924,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class FlavorNew(GenericAPIView):
-    serializer_class = FlavorSerializer
-    id_serializer_class = FlavorIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = Flavor()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class ProjectList(generics.ListCreateAPIView):
@@ -2667,7 +2946,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -2701,31 +2983,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class ProjectNew(GenericAPIView):
-    serializer_class = ProjectSerializer
-    id_serializer_class = ProjectIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = Project()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class SliceList(generics.ListCreateAPIView):
@@ -2748,7 +3005,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -2782,31 +3042,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class SliceNew(GenericAPIView):
-    serializer_class = SliceSerializer
-    id_serializer_class = SliceIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = Slice()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class NetworkList(generics.ListCreateAPIView):
@@ -2829,7 +3064,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -2863,31 +3101,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class NetworkNew(GenericAPIView):
-    serializer_class = NetworkSerializer
-    id_serializer_class = NetworkIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = Network()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class ServiceList(generics.ListCreateAPIView):
@@ -2910,7 +3123,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -2944,31 +3160,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class ServiceNew(GenericAPIView):
-    serializer_class = ServiceSerializer
-    id_serializer_class = ServiceIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = Service()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class ServiceClassList(generics.ListCreateAPIView):
@@ -2991,7 +3182,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -3025,31 +3219,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class ServiceClassNew(GenericAPIView):
-    serializer_class = ServiceClassSerializer
-    id_serializer_class = ServiceClassIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = ServiceClass()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class PaymentList(generics.ListCreateAPIView):
@@ -3072,7 +3241,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -3106,31 +3278,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class PaymentNew(GenericAPIView):
-    serializer_class = PaymentSerializer
-    id_serializer_class = PaymentIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = Payment()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class ChargeList(generics.ListCreateAPIView):
@@ -3153,7 +3300,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -3187,31 +3337,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class ChargeNew(GenericAPIView):
-    serializer_class = ChargeSerializer
-    id_serializer_class = ChargeIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = Charge()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class RoleList(generics.ListCreateAPIView):
@@ -3234,7 +3359,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -3268,31 +3396,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class RoleNew(GenericAPIView):
-    serializer_class = RoleSerializer
-    id_serializer_class = RoleIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = Role()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class UsableObjectList(generics.ListCreateAPIView):
@@ -3315,7 +3418,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -3349,31 +3455,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class UsableObjectNew(GenericAPIView):
-    serializer_class = UsableObjectSerializer
-    id_serializer_class = UsableObjectIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = UsableObject()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class SiteRoleList(generics.ListCreateAPIView):
@@ -3396,7 +3477,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -3430,31 +3514,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class SiteRoleNew(GenericAPIView):
-    serializer_class = SiteRoleSerializer
-    id_serializer_class = SiteRoleIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = SiteRole()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class SliceCredentialList(generics.ListCreateAPIView):
@@ -3477,7 +3536,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -3511,31 +3573,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class SliceCredentialNew(GenericAPIView):
-    serializer_class = SliceCredentialSerializer
-    id_serializer_class = SliceCredentialIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = SliceCredential()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class SliverList(generics.ListCreateAPIView):
@@ -3558,7 +3595,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -3592,31 +3632,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class SliverNew(GenericAPIView):
-    serializer_class = SliverSerializer
-    id_serializer_class = SliverIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = Sliver()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class NodeList(generics.ListCreateAPIView):
@@ -3639,7 +3654,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -3673,31 +3691,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class NodeNew(GenericAPIView):
-    serializer_class = NodeSerializer
-    id_serializer_class = NodeIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = Node()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class DashboardViewList(generics.ListCreateAPIView):
@@ -3720,7 +3713,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -3754,31 +3750,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class DashboardViewNew(GenericAPIView):
-    serializer_class = DashboardViewSerializer
-    id_serializer_class = DashboardViewIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = DashboardView()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class ImageDeploymentsList(generics.ListCreateAPIView):
@@ -3801,7 +3772,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -3835,31 +3809,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class ImageDeploymentsNew(GenericAPIView):
-    serializer_class = ImageDeploymentsSerializer
-    id_serializer_class = ImageDeploymentsIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = ImageDeployments()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class ReservedResourceList(generics.ListCreateAPIView):
@@ -3882,7 +3831,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -3916,31 +3868,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class ReservedResourceNew(GenericAPIView):
-    serializer_class = ReservedResourceSerializer
-    id_serializer_class = ReservedResourceIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = ReservedResource()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class NetworkSliceList(generics.ListCreateAPIView):
@@ -3963,7 +3890,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -3997,31 +3927,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class NetworkSliceNew(GenericAPIView):
-    serializer_class = NetworkSliceSerializer
-    id_serializer_class = NetworkSliceIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = NetworkSlice()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class UserDashboardViewList(generics.ListCreateAPIView):
@@ -4044,7 +3949,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -4078,31 +3986,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class UserDashboardViewNew(GenericAPIView):
-    serializer_class = UserDashboardViewSerializer
-    id_serializer_class = UserDashboardViewIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = UserDashboardView()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class PlanetStackPrivilegeList(generics.ListCreateAPIView):
@@ -4125,7 +4008,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -4159,31 +4045,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class PlanetStackPrivilegeNew(GenericAPIView):
-    serializer_class = PlanetStackPrivilegeSerializer
-    id_serializer_class = PlanetStackPrivilegeIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = PlanetStackPrivilege()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class UserList(generics.ListCreateAPIView):
@@ -4206,7 +4067,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -4240,31 +4104,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class UserNew(GenericAPIView):
-    serializer_class = UserSerializer
-    id_serializer_class = UserIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = User()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class DeploymentList(generics.ListCreateAPIView):
@@ -4287,7 +4126,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -4321,31 +4163,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class DeploymentNew(GenericAPIView):
-    serializer_class = DeploymentSerializer
-    id_serializer_class = DeploymentIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = Deployment()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class ReservationList(generics.ListCreateAPIView):
@@ -4368,7 +4185,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -4402,31 +4222,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class ReservationNew(GenericAPIView):
-    serializer_class = ReservationSerializer
-    id_serializer_class = ReservationIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = Reservation()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class SliceDeploymentsList(generics.ListCreateAPIView):
@@ -4449,7 +4244,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -4483,31 +4281,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class SliceDeploymentsNew(GenericAPIView):
-    serializer_class = SliceDeploymentsSerializer
-    id_serializer_class = SliceDeploymentsIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = SliceDeployments()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class SitePrivilegeList(generics.ListCreateAPIView):
@@ -4530,7 +4303,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -4564,31 +4340,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class SitePrivilegeNew(GenericAPIView):
-    serializer_class = SitePrivilegeSerializer
-    id_serializer_class = SitePrivilegeIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = SitePrivilege()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class PlanetStackList(generics.ListCreateAPIView):
@@ -4611,7 +4362,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -4645,31 +4399,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class PlanetStackNew(GenericAPIView):
-    serializer_class = PlanetStackSerializer
-    id_serializer_class = PlanetStackIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = PlanetStack()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class UserDeploymentsList(generics.ListCreateAPIView):
@@ -4692,7 +4421,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -4726,31 +4458,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class UserDeploymentsNew(GenericAPIView):
-    serializer_class = UserDeploymentsSerializer
-    id_serializer_class = UserDeploymentsIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = UserDeployments()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class AccountList(generics.ListCreateAPIView):
@@ -4773,7 +4480,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -4807,31 +4517,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class AccountNew(GenericAPIView):
-    serializer_class = AccountSerializer
-    id_serializer_class = AccountIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = Account()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class NetworkParameterTypeList(generics.ListCreateAPIView):
@@ -4854,7 +4539,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -4888,31 +4576,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class NetworkParameterTypeNew(GenericAPIView):
-    serializer_class = NetworkParameterTypeSerializer
-    id_serializer_class = NetworkParameterTypeIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = NetworkParameterType()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class SiteCredentialList(generics.ListCreateAPIView):
@@ -4935,7 +4598,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -4969,31 +4635,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class SiteCredentialNew(GenericAPIView):
-    serializer_class = SiteCredentialSerializer
-    id_serializer_class = SiteCredentialIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = SiteCredential()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class DeploymentPrivilegeList(generics.ListCreateAPIView):
@@ -5016,7 +4657,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -5050,31 +4694,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class DeploymentPrivilegeNew(GenericAPIView):
-    serializer_class = DeploymentPrivilegeSerializer
-    id_serializer_class = DeploymentPrivilegeIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = DeploymentPrivilege()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class DeploymentRoleList(generics.ListCreateAPIView):
@@ -5097,7 +4716,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -5131,31 +4753,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class DeploymentRoleNew(GenericAPIView):
-    serializer_class = DeploymentRoleSerializer
-    id_serializer_class = DeploymentRoleIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = DeploymentRole()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class UserCredentialList(generics.ListCreateAPIView):
@@ -5178,7 +4775,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -5212,31 +4812,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class UserCredentialNew(GenericAPIView):
-    serializer_class = UserCredentialSerializer
-    id_serializer_class = UserCredentialIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = UserCredential()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class SiteDeploymentsList(generics.ListCreateAPIView):
@@ -5259,7 +4834,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -5293,31 +4871,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class SiteDeploymentsNew(GenericAPIView):
-    serializer_class = SiteDeploymentsSerializer
-    id_serializer_class = SiteDeploymentsIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = SiteDeployments()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class SliceTagList(generics.ListCreateAPIView):
@@ -5340,7 +4893,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -5374,31 +4930,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class SliceTagNew(GenericAPIView):
-    serializer_class = SliceTagSerializer
-    id_serializer_class = SliceTagIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = SliceTag()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class NetworkTemplateList(generics.ListCreateAPIView):
@@ -5421,7 +4952,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -5455,31 +4989,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class NetworkTemplateNew(GenericAPIView):
-    serializer_class = NetworkTemplateSerializer
-    id_serializer_class = NetworkTemplateIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = NetworkTemplate()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class RouterList(generics.ListCreateAPIView):
@@ -5502,7 +5011,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -5536,31 +5048,6 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class RouterNew(GenericAPIView):
-    serializer_class = RouterSerializer
-    id_serializer_class = RouterIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = Router()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
 class ServiceResourceList(generics.ListCreateAPIView):
@@ -5583,7 +5070,10 @@
     def create(self, request, *args, **kwargs):
         serializer = self.get_serializer(data=request.DATA, files=request.FILES)
         if not (serializer.is_valid()):
-            raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+            response = {"error": "validation",
+                        "specific_error": "not serializer.is_valid()",
+                        "reasons": serializer.errors}
+            return Response(response, status=status.HTTP_400_BAD_REQUEST)
         obj = serializer.object
         obj.caller = request.user
         if obj.can_update(request.user):
@@ -5617,30 +5107,5 @@
 
     # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
 
-"""
-    XXX smbaker: my intent was to create a view that would return 'new' objects
-    filled with defaults. I solved it another way, so this code may soon be
-    abandoned.
-
-class ServiceResourceNew(GenericAPIView):
-    serializer_class = ServiceResourceSerializer
-    id_serializer_class = ServiceResourceIdSerializer
-
-    def get(self, request, *args, **kwargs):
-        return self.makenew(request, *args, **kwargs)
-
-    def get_serializer_class(self):
-        no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
-        if (no_hyperlinks):
-            return self.id_serializer_class
-        else:
-            return self.serializer_class
-
-    def makenew(self, request, *args, **kwargs):
-        obj = ServiceResource()
-        serializer = self.get_serializer(obj)
-        return Response(serializer.data)
-"""
-
 
 
