fix condition in ApiRequest