moved server code to server.js
fixed mongodb write concern
added config
updated credetials location
updated credentials configuration