public function set(string $link = null, string $method = null): \TheCMSThread\Classes\API
    {
        if ($link === null) {
            if (isset($_SERVER['REQUEST_URI']) === false) {
                $_SERVER['REQUEST_URI'] = '/';
            }
            $link = str_replace("?" . $_SERVER["QUERY_STRING"], "", $_SERVER["REQUEST_URI"]);
        }
        $link = '/' . trim($link, '/');

        if ($method === null) {
            if (isset($_SERVER['REQUEST_METHOD']) === false) {
                $_SERVER['REQUEST_METHOD'] = 'GET';
            }
            $method = $_SERVER['REQUEST_METHOD'];
        }
        if ($method == 'POST' && empty($_POST['_method']) === false) {
            $method = $_POST['_method'];
            unset($_POST['_method']);
        }

        $this->match = $this->router->match($link, $method);
        return $this;
    }