change mongoose to 3.8.x
refactored the code to new express formate