public function getEndpoints($withHost = true, $prefix = null, $host = '', $withBasePath = true)
    {
        $endpoints = [];
        $basePath = "";
        if ($withHost) {
            $basePath = (empty($host)) ? $this->getHost() : $host;
        }
        if (!empty($prefix)) {
            $basePath .= $prefix;
        }
        if ($withBasePath && isset($this->basePath)) {
            $basePath .= $this->basePath;
        }
        foreach ($this->endpoints as $endpoint) {
            $endpoints[] = $basePath.$endpoint;
        }

        return $endpoints;
    }