Added express error handler and refactored db file structure