Added 404 and 500 error handlers.

Also returning 404s for invalid URLs.