Password now gets hashed before saving in the database. Wrote authenticate function in app/model/user.js.