Registered api error handler