restructured application, added mongoose support