restructured app, connects to mongodb