Return 404 errors as JSON