title: NodeJS Express/Mongoose route confusion
body: <p>I must not be understanding something correctly here. My route looks like this</p>
  
  <pre><code>function(req,res){
        var thingId = validate.thingId(req.body) ? req.body.thingId  : res.send(400,'Invalid Thing');
  
        var newBlock = new Block({
             thing : mongoose.Types.ObjectId(thingId)
        }).save();
   }
  </code></pre>
  
  <p>I am passing in an empty string in req.body.thingId to test the validation function. It return false as it should, the server returns the 400 error as it should, but I am getting the error
  "Argument passed in must be a single String of 12 bytes or a string of 24 hex characters." (it's talking about the model id). </p>
  
  <p>So obviously newBlock is still being created and thingId is being passed into the mongoose.Types.ObjectId function. </p>
  
  <p>I was under the (probably wrong) impression that calling res.send would essentially be like 'return' and code after it would not run. I can't see how this could be an async problem, could anyone point me in the right direction?</p>