Cleaned up error response handling.