protected function createREST($first, $last = null, $api_url = self::API_URL)
    {
        if ($first instanceof OAuthToken) {
            $rest = new REST(array(
                'server' => $api_url,
                'debug_mode' => $this->debug_mode
            ));
            $auth = $first->getTokenType() . ' ' . $first->getAccessToken();
            $rest->setHeader('Authorization', $auth);

            return $rest;
        }

        return new REST(array(
            'server' => $api_url,
            'user'   => $first,
            'pass'   => $last,
            'debug_mode' => $this->debug_mode
        ));
    }