public function request($resource, $args = array())
    {

        $url = $this->buildUrl($resource, $args);
        $curl = curl_init($url);

        curl_setopt_array($curl, $this->options);
        $this->contents = curl_exec($curl);
        $this->setDebug($curl);

        if (curl_errno($curl) > 0) {
            throw new \Exception('There was an error while making the request');
        }

        $jsonDecodeContent = json_decode($this->contents, true);

        if(is_null($jsonDecodeContent)) {
            throw new \Exception('Unable to decode JSON response');
        }

        return $jsonDecodeContent;
    }