title: PUT is broken when I define method before save, in loopback
body: <p>I try to change some field when I create/update data whith loopback. The POST method works, but now the PUT method is down.</p>
  
  <p>my category.json:</p>
  
  <pre><code>{
   "name": "category",
   "base": "PersistedModel",
   "properties": {
     "name": {
       "type": "string",
       "required": true
     },
     "image": {
       "type": "string",
       "required": true
     }
   },
   "validations": [],
   "relations": {},
   "acls": [],
   "methods": []
  }
  </code></pre>
  
  <p>and the category.js for define methods:</p>
  
  <pre><code>module.exports = function(categorie) {
  
    categorie.observe('before save', function(ctx, next){
  
      ctx.instance.name = ctx.instance.name.toUpperCase().trim();
      ctx.instance.image = ctx.instance.image.trim();
      ctx.instance.image = ctx.instance.image.charAt(0).toUpperCase() + ctx.instance.image.slice(1);
  
      next();
    });
  };
  </code></pre>
  
  <p>I receive this error message:</p>
  
  <p>{
    "error": {
      "name": "TypeError",
      "status": 500,
      "message": "Cannot read property 'name' of undefined",
      "stack": "TypeError: Cannot read property 'name' of undefined\n    at /home/pitt/warm-wildwood-2324/common/models/category.js:5:35\n    at notifySingleObserver (/home/pitt/warm-wildwood-2324/node_modules/loopback-datasource-juggler/lib/model.js:600:22)\n   (...)    at Function.ModelBaseClass.notifyObserversOf (/home/pitt/warm-wildwood-2324/node_modules/loopback-datasource-juggler/lib/model.js:593:8)"
    }
  }</p>