Fixing http response code in case of error scenario.