use localhost mongodb server
merge
rewrite app.js to make it more maintainable