Updated Error response handling.