adding 404 and 500 error routes
code clean up