moving routes into their own file
moved routes out of server.js. now checking if sql is open; quit otherwise