protected function make_url($uri, $params = array(), $uploadapi = false) {
        $api = $uploadapi ? self::UPLOAD_API : self::API;
        $url = new moodle_url($api . '/' . ltrim($uri, '/'), $params);
        return $url->out(false);
    }