private function setHandler($authorization)
    {
        $stack = new HandlerStack();

        $stack->setHandler(new CurlHandler());

        // Set authorization headers
        $this->authorization = $authorization;
        $stack->push(Middleware::mapRequest(function (Request $request) {
                return $request->withHeader('Authorization', $this->authorization);
        }), 'set_authorization_header');
        
        // Set the request ui
        $stack->push(Middleware::mapRequest(function (Request $request) {
            $uri = $request->getUri()->withHost($this->host)->withScheme($this->scheme);

            return $request->withUri($uri);
        }), 'set_host');

        return $stack;
    }