handle ClientError, ServerError status codes