Added error handling for 4xx/5xx responses.