use of angular.extend, more restify, node.js + mongodb