private function createStartingPromise(
        ClientRequestInterface $request,
        callable $startingSuccessCallback = null,
        callable $startingFailCallback = null
    ): ApiResponseInterface {
        if (!$startingSuccessCallback) {
            $startingSuccessCallback = function (ResponseInterface $response) use ($request) {
                return $request->mapFromResponse($request->buildResponse($response));
            };
        }

        if (!$startingFailCallback) {
            $startingFailCallback = function (RequestException $exception) {
                return ApiException::create($exception->getRequest(), $exception->getResponse(), $exception);
            };
        }

        return $this->getClient()->executeAsync($request)->then($startingSuccessCallback, $startingFailCallback);
    }