private function prepareUrl($path)
    {
        $bits = parse_url($path);

        $path = isset($bits['path']) && $bits['path'] ? $bits['path'] : '/';

        if (substr($path, 0, 1) !== '/') {
            $path = '/' . $path;
        }

        $query = isset($bits['query']) && $bits['query'] ? '?' . $bits['query'] : '';

        return $this->getUrl() . '/api/v' . $this->getApiVersion() . $path . $query;
    }