Better error handling, including 404 errors