I am having a normal HTML frontend and a JSON API in my Rails App. Now, if someone calls /api/not_existent_method.json
it returns the default HTML 404 page. Is there any way to change this to something like {"error": "not_found"}
while leaving the original 404 page for the HTML frontend intact?