abstracted some of the logic out of routes and into the server & db files.  Also, reusing db file across all routes now.