correctly format http error code in response