handle http_code in service endpoint