fix http codes returned by api in case of errors