Properly configure express router and error handler