Fix index 404

Given than resource `abc` does not exist, visiting `/api/abc` throws an error (500) instead of responding with a 404. This change fixes that.