Fixed bug with express routing for 404s and cleaned up code.