public function request($method, $scope = null, $data = null)
    {
        if (is_array($scope)) {
            $data = $scope;
            $scope = null;
        }
        $url = $scope ? $this->url.'/'.ltrim($scope, '/') : $this->url;
        $result = self::$client->request($method, $url, $data);
        if (!$scope && $result instanceof Resource) {
            // TODO: how should POST be handled here?
            foreach ($result->data() as $key => $value) {
                self::offsetSet($key, $value);
            }
        }
        return $scope ? $result : $this;
    }