organizing api code

api code split up into modules, still left original functionality
commented in server.js (will remove in next commit)
clean up server

works for now