Fixed bad usage of defer.
Proper 404 handling. Better request path based handling.