title: Cloud Code object.save() results in 'object not found' with very strange PUT command
body: <h3>Issue Description</h3>
  
  <p>I have a simple Cloud Code command to create or update an object.  If there is NO objectId passed in, the routine creates a new object and returns the objectId.  If the objectId exists in the parameter list, it fetches the object and updates the parameters accordingly.</p>
  
  <p>The routine works for new objects fine.</p>
  
  <p>The <code>object.save()</code> is failing when I try to update an object, despite the <code>object.fetch()</code> sub-routine working.</p>
  
  <blockquote>
    <p>error: code=101, message=Object not found.</p>
  </blockquote>
  
  <p>Verbose server logs indicate a very strange <code>PUT</code> command...</p>
  
  <blockquote>
    <p>PUT /parse/classes/Receipt/[object%20Object]</p>
  </blockquote>
  
  <p>what I would expect to see is</p>
  
  <blockquote>
    <p>PUT /parse/classes/Receipt/GJaXcf7fLD</p>
  </blockquote>
  
  <p>Object ACL is public r+w</p>
  
  <p><strong>Why is the <code>object.save()</code> not working with a valid objectId?</strong></p>
  
  <p>_</p>
  
  <p><strong>Cloud Code</strong></p>
  
  <pre><code>Parse.Cloud.define("uploadReceipt", function(request,response) {
      var Receipt = Parse.Object.extend("Receipt");
      var receipt = new Receipt();
  
      // passed in parameters are ['property' : ['type' : t, 'value' : v]]
      var dict = request.params;
      var objectIdDict = dict["objectId"];
      console.log("Object Dict: " + objectIdDict);
      Parse.Promise.as().then(function() {
          // if we already have an objectId we are UPDATING
          // Need to FETCH first
          if (objectIdDict != undefined) {
              console.log("Searching for ID: " + objectIdDict["value"]);
              receipt.set("objectId",objectIdDict["value"]);
              return receipt.fetch();
          }
          else {
              console.log("NEW RECEIPT");
              return Parse.Promise.as(receipt);
          }
  
      }).then(function(receipt) {
          console.log("Receipt: " + receipt.id);
          // copy over the keys from our passed in parameters to the object
          for (var key in dict) {
              //console.log("Key: " + key + "   Value: " + dict[key]["value"]);
              if (dict[key]["type"] == "Raw") {
                  console.log("Key: " + key + "   Value: " + dict[key]["value"]);
                  receipt.set(key,dict[key]["value"]);
              }
              else if (dict[key]["type"] == "Date" &amp;&amp; key != "updatedAt") {
                  console.log("Key: " + key + "   Value: " + dict[key]["value"]);
                  var time = dict[key]["value"] * 1000;   // milliseconds
                  receipt.set(key,new Date(time));
              }
              else {
                  // object type
                  var Obj = Parse.Object.extend(dict[key]["type"]);
                  var newObj = new Obj();
                  newObj.id = dict[key]["value"];
                  receipt.set(key,newObj);
              }
          }
  
          // make sure our user is set
          receipt.set("user",request.user);
  
          // adjust the status because it has now been uploaded
          receipt.set("status",RECEIPT_SUBMITTED);
  
          console.log("Prior to save");
          return receipt.save();
  
      }).then(function(receipt) {
          console.log("Finished");
          response.success({"status":receipt.get("status"),"objectId":receipt.id});
  
      },function (error) {
          console.log(error);
          response.error(error);
      });
  });
  </code></pre>
  
  <h3>Steps to reproduce</h3>
  
  <ol>
  <li>Call the cloud code from iOS SDK with data for a new object</li>
  <li>Notice that the command works and a new object is added to the database</li>
  <li>Call the command again with updated information</li>
  <li>Notice that the command fails with <strong>object not found</strong></li>
  </ol>
  
  <h3>Expected Results</h3>
  
  <p>Object should be updated accordingly</p>
  
  <h3>Actual Outcome</h3>
  
  <blockquote>
    <p>error: code=101, message=Object not found.</p>
  </blockquote>
  
  <h3>Environment Setup</h3>
  
  <ul>
  <li><p><strong>Server</strong></p>
  
  <ul>
  <li>parse-server version: 2.2.12</li>
  <li>Operating System:     Mac OS X 10.11.5</li>
  <li>Hardware:                  MacBook Pro 2010</li>
  <li>Localhost or remote server? Localhost</li>
  <li>Javascript:                 Parse/js1.8.5</li>
  <li>NodeJS                      5.10.1</li>
  </ul></li>
  <li><p><strong>Database</strong></p>
  
  <ul>
  <li>MongoDB version:  3.2.4</li>
  <li>Hardware:         MacBook Pro 2010</li>
  <li>Localhost or remote server? Localhost</li>
  </ul></li>
  </ul>
  
  <h3>Logs/Trace</h3>
  
  <p><strong>Storing NEW object returns</strong></p>
  
  <pre><code>verbose: POST /parse/classes/Receipt { 'user-agent': 'node-XMLHttpRequest, Parse/js1.8.5 (NodeJS 5.10.1)',
    accept: '*/*',
    'content-type': 'text/plain',
    host: 'localhost:1337',
    'content-length': '471',
    connection: 'close' } {
    "date": {
      "__type": "Date",
      "iso": "2016-06-19T00:30:37.492Z"
    },
    "category": {
      "__type": "Pointer",
      "className": "Category",
      "objectId": "XZ1bSHtZBY"
    },
    "status": 0,
    "amount": 61.45,
    "notes": "Hopefully this works well",
    "gui_status": -1,
    "currency": "USD",
    "user": {
      "__type": "Pointer",
      "className": "_User",
      "objectId": "vL4ih9BAX8"
    }
  }
  verbose: {
    "status": 201,
    "response": {
      "objectId": "GJaXcf7fLD",
      "createdAt": "2016-06-19T00:30:57.092Z"
    },
    "location": "http://localhost:1337/parse/classes/Receipt/GJaXcf7fLD"
  }
  Finished
  verbose: {
    "response": {
      "result": {
        "status": 0,
        "objectId": "GJaXcf7fLD"
      }
    }
  }
  </code></pre>
  
  <p><strong>Attempt to Update object returns</strong></p>
  
  <pre><code>verbose: PUT /parse/classes/Receipt/[object%20Object] { 'user-agent': 'node-XMLHttpRequest, Parse/js1.8.5 (NodeJS 5.10.1)',
    accept: '*/*',
    'content-type': 'text/plain',
    host: 'localhost:1337',
    'content-length': '473',
    connection: 'close' } {
    "category": {
      "__type": "Pointer",
      "className": "Category",
      "objectId": "XZ1bSHtZBY"
    },
    "status": 0,
    "amount": 5.47,
    "notes": "How about now",
    "gui_status": 0,
    "date": {
      "__type": "Date",
      "iso": "2016-06-19T00:12:25.788Z"
    },
    "currency": "USD",
    "user": {
      "__type": "Pointer",
      "className": "_User",
      "objectId": "vL4ih9BAX8"
    }
  }
  verbose: error: code=101, message=Object not found.
  ParseError { code: 101, message: 'Object not found.' }
  verbose: error: code=141, code=101, message=Object not found.
  </code></pre>