move server inside the mongo connect callback

only spin up the server if the database is connected
moved mongo url to config.json