exported the models and moved db connection to server.js
added db connection logic