set correct http response status code in case of error