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 %}
