diff --git a/Dockerfile b/Dockerfile
index 3c56d8a..3a29989 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,3 +1,5 @@
+# docker build -t xosproject/xos-tosca:candidate .
+
 # xosproject/xos-tosca
 FROM xosproject/xos-client:candidate
 
diff --git a/src/grpc_client/main.py b/src/grpc_client/main.py
index aa13362..edda57c 100644
--- a/src/grpc_client/main.py
+++ b/src/grpc_client/main.py
@@ -31,8 +31,6 @@
         self.grpc_secure_endpoint = secure + ":50051"
         self.grpc_insecure_endpoint = insecure + ":50055"
 
-        print self.grpc_secure_endpoint, self.grpc_insecure_endpoint
-
     def setup_resources(self, client, key, deferred, recipe):
         print "[XOS-TOSCA] Loading resources"
         if key not in RESOURCES:
diff --git a/src/grpc_client/models_accessor.py b/src/grpc_client/models_accessor.py
index 079915a..b51ee90 100644
--- a/src/grpc_client/models_accessor.py
+++ b/src/grpc_client/models_accessor.py
@@ -30,8 +30,11 @@
         if data.get('name'):
             used_key = 'name'
         else:
-            # FIXME apparently we're not matching model without a name field
-            used_key = data.keys()[0]
+            if len(data.keys()) > 0:
+                # FIXME apparently we're not matching model without a name field
+                used_key = data.keys()[0]
+            else:
+                used_key = None
 
         key = "%s~%s" % (username, password)
         if not key in RESOURCES:
@@ -40,7 +43,11 @@
             raise Exception('[XOS-TOSCA] The model you are trying to create (%s: %s, class: %s) is not know by xos-core' % (used_key, data[used_key], class_name))
 
         cls = RESOURCES[key][class_name]
-        models = cls.objects.filter(**{used_key: data[used_key]})
+        if used_key:
+            models = cls.objects.filter(**{used_key: data[used_key]})
+        else:
+            # NOTE if we don't have a way to track the model, create a new one
+            models = []
 
         if len(models) == 1:
             print "[XOS-Tosca] Model %s already exist, retrieving instance..." % data[used_key]
@@ -51,7 +58,8 @@
                 raise Exception("[XOS-TOSCA] Model %s:%s has property 'must-exist' but cannot be found" % (class_name, data[used_key]))
 
             model = cls.objects.new()
-            print "[XOS-Tosca] Model %s is new, creating new instance..." % data[used_key]
+            print "[XOS-Tosca] Model %s is new, creating new instance..." % data[used_key] if used_key else class_name
         else:
             raise Exception("[XOS-Tosca] Model %s has multiple instances, I can't handle it" % data[used_key])
+
         return model
\ No newline at end of file
diff --git a/src/tosca/parser.py b/src/tosca/parser.py
index 7c14243..acbd5f1 100644
--- a/src/tosca/parser.py
+++ b/src/tosca/parser.py
@@ -98,20 +98,24 @@
     @staticmethod
     def populate_model(model, data):
         for k,v in data.iteritems():
-            setattr(model, k, v)
+            # NOTE must-exists is a TOSCA implementation choice, remove it before saving the model
+            if k != "must-exist":
+                setattr(model, k, v)
         return model
 
     @staticmethod
     def _translate_exception(msg):
         readable = []
         for line in msg.splitlines():
-            if line.strip().startswith('MissingRequiredFieldError'):
-                readable.append(line)
-            if line.strip().startswith('UnknownFieldError'):
+            if line.strip().startswith('MissingRequiredFieldError') or \
+                    line.strip().startswith('UnknownFieldError') or \
+                    line.strip().startswith('ImportError') or \
+                    line.strip().startswith('InvalidTypeError') or \
+                    line.strip().startswith('TypeMismatchError'):
                 readable.append(line)
 
         if len(readable) > 0:
-            return '/n'.join(readable)
+            return '\n'.join(readable) + '\n'
         else:
             return msg
 
@@ -184,23 +188,33 @@
             self.ordered_models_template = self.get_ordered_models_template(self.ordered_models_name, self.templates_by_model_name)
 
             for recipe in self.ordered_models_template:
-                # get properties from tosca
-                data = recipe.templates[recipe.name]['properties']
-                # [] get model by class name
-                class_name = recipe.type.replace("tosca.nodes.", "")
-                model = GRPCModelsAccessor.get_model_from_classname(class_name, data, self.username, self.password)
-                # [] populate model with data
-                model = self.populate_model(model, data)
-                # [] check if the model has requirements
-                # [] if it has populate them
-                model = self.populate_dependencies(model, recipe.requirements, self.saved_model_by_name)
-                # [] save, update or delete
-                if self.delete and not model.is_new:
-                    model.delete()
-                elif not self.delete:
-                    model.save()
+                try:
+                    # get properties from tosca
+                    if not 'properties' in recipe.templates[recipe.name]:
+                        data = {}
+                    else:
+                        data = recipe.templates[recipe.name]['properties']
+                        if data == None:
+                            data = {}
+                    # [] get model by class name
+                    class_name = recipe.type.replace("tosca.nodes.", "")
+                    model = GRPCModelsAccessor.get_model_from_classname(class_name, data, self.username, self.password)
+                    # [] populate model with data
+                    model = self.populate_model(model, data)
+                    # [] check if the model has requirements
+                    # [] if it has populate them
+                    model = self.populate_dependencies(model, recipe.requirements, self.saved_model_by_name)
+                    # [] save, update or delete
 
-                self.saved_model_by_name[recipe.name] = model
+                    if self.delete and not model.is_new:
+                        model.delete()
+                    elif not self.delete:
+                        model.save()
+
+                    self.saved_model_by_name[recipe.name] = model
+                except Exception, e:
+                    print "[XOS-TOSCA] Failed to save model: %s [%s]" % (class_name, recipe.name)
+                    raise e
 
         except ValidationError as e:
             if e.message:
@@ -216,6 +230,6 @@
                 exception_msg = e._state.details
             raise Exception(exception_msg)
         except Exception, e:
-            raise e
+            raise Exception(e)
 
 
diff --git a/src/tosca/xtarget/tosca.xtarget b/src/tosca/xtarget/tosca.xtarget
index 5faafee..f0eb78b 100644
--- a/src/tosca/xtarget/tosca.xtarget
+++ b/src/tosca/xtarget/tosca.xtarget
@@ -5,6 +5,20 @@
 
 node_types:
 
+    # Example usage:
+    #
+    # <node-name>:
+    #     type: tosca.nodes.{{ m.name }}
+    #     properties:
+    #       must-exist: true # optional to reference models created in other recipes
+{%- for f in (m.fields + xproto_base_fields(m, proto.message_table)) | sort(attribute='name') %}
+{%- if not f.link and xproto_tosca_required(f.options.null, f.options.blank, f.options.default) %}
+    #       {{ f.name }}: <value>
+{%- endif -%}
+{%- endfor %}
+
+
+
     tosca.nodes.{{ m.name }}:
         derived_from: tosca.nodes.Root
         description: {% if m.options.description -%}{{ m.options.description}}{% else%}"An XOS {{ m.name }}"{%- endif %}
@@ -27,6 +41,16 @@
 
     {% for l in m.links %}
     {%- if l.link_type == "manytoone" -%}
+
+
+    # Identify a {{ l.peer.name }} that belongs to a {{ m.name }}
+    #
+    # example usage:
+    # requirements:
+    #   - {{ l.src_port }}:
+    #       node: <node-name>:
+    #       relationship: tosca.relationships.BelongsToOne
+
     tosca.relationships.BelongsToOne:
         derived_from: tosca.relationships.Root
         valid_target_types: [ tosca.capabilities.xos.{{ l.peer.name }} ]
diff --git a/src/web_server/main.py b/src/web_server/main.py
index 319654b..632b943 100644
--- a/src/web_server/main.py
+++ b/src/web_server/main.py
@@ -37,12 +37,17 @@
     app = Klein()
 
     def execute_tosca(self, recipe):
+        self.parser.execute()
+        response_text = "Created models: %s" % str(self.parser.ordered_models_name)
+        return response_text
+
+    def errorCallback(self, failure, request):
+        request.setResponseCode(500)
         try:
-            self.parser.execute()
-            response_text = "Created models: %s" % str(self.parser.ordered_models_name)
-            return response_text
-        except Exception, e:
-            return e.message
+            return failure.getErrorMessage()
+        except:
+            print failure
+            return "Internal server error, please report this along with the failed recipe."
 
     @app.route('/', methods=['GET'])
     def index(self, request):
@@ -70,7 +75,8 @@
 
         d = GRPC_Client().create_secure_client(username, password, recipe)
         self.parser = TOSCA_Parser(recipe, username, password)
-        d.addCallback(self.execute_tosca)
+        tosca_execution = d.addCallback(self.execute_tosca)
+        tosca_execution.addErrback(self.errorCallback, request)
         return d
 
     @app.route('/delete', methods=['POST'])
@@ -82,7 +88,8 @@
 
         d = GRPC_Client().create_secure_client(username, password, recipe)
         self.parser = TOSCA_Parser(recipe, username, password, delete=True)
-        d.addCallback(self.execute_tosca)
+        tosca_execution = d.addCallback(self.execute_tosca)
+        tosca_execution.addErrback(self.errorCallback, request)
         return d
 
     def __init__(self):
diff --git a/test/test_grpc_models_accessor.py b/test/test_grpc_models_accessor.py
index ffafaa3..3851857 100644
--- a/test/test_grpc_models_accessor.py
+++ b/test/test_grpc_models_accessor.py
@@ -120,5 +120,16 @@
         mock_filter.assert_called_with(foo="bar")
         mock_new.assert_called()
 
+    @patch.dict(RESOURCES, mock_resources, clear=True)
+    @patch.object(FakeResource.objects, "new")
+    def test_model_without_properties(self, mock_new):
+        """
+        [GRPCModelsAccessor] get_model_from_classname: should create a new model if not properties are specified
+        """
+        data = {
+        }
+        GRPCModelsAccessor.get_model_from_classname('test-model', data, USERNAME, PASSWORD)
+        mock_new.assert_called()
+
 if __name__ == '__main__':
     unittest.main()
\ No newline at end of file
diff --git a/test/test_tosca_generator.py b/test/test_tosca_generator.py
index 4e3ecda..0011d31 100644
--- a/test/test_tosca_generator.py
+++ b/test/test_tosca_generator.py
@@ -78,7 +78,7 @@
         args.write_to_file = 'target'
         args.quiet = False
         output = XOSGenerator.generate(args)
-        self.assertEqual(output.count("name:"), 2)
+        self.assertEqual(output.count("name:"), 4)
         self.assertIn("prop:", output)
 
 if __name__ == '__main__':
diff --git a/test/test_tosca_parser.py b/test/test_tosca_parser.py
index c8d8947..829fed0 100644
--- a/test/test_tosca_parser.py
+++ b/test/test_tosca_parser.py
@@ -175,8 +175,21 @@
         python error
         starting at line
             38209834 of some file
+UnknownFieldError: with some message
+    followed by useless things
+ImportError: with some message
+    followed by useless things
+InvalidTypeError: with some message
+    followed by useless things
+TypeMismatchError: with some message
+    followed by useless things
         """)
-        self.assertEqual(e, "MissingRequiredFieldError: some message")
+        self.assertEqual(e, """MissingRequiredFieldError: some message
+UnknownFieldError: with some message
+ImportError: with some message
+InvalidTypeError: with some message
+TypeMismatchError: with some message
+""")
 
     def test_save_recipe_to_tmp_file(self):
         """
diff --git a/test/test_tosca_parser_e2e.py b/test/test_tosca_parser_e2e.py
index 5e1f916..a4c8e29 100644
--- a/test/test_tosca_parser_e2e.py
+++ b/test/test_tosca_parser_e2e.py
@@ -220,4 +220,4 @@
         with self.assertRaises(Exception) as e:
             parser.execute()
 
-        self.assertEqual(e.exception.message, "[XOS-TOSCA] Model Site:Open Networking Lab has property 'must-exist' but cannot be found")
+        self.assertEqual(e.exception.message.message, "[XOS-TOSCA] Model Site:Open Networking Lab has property 'must-exist' but cannot be found")
