public function initializeFrontEndUser($pageId = 0, $type = 0)
    {
        if (array_key_exists('TSFE', $GLOBALS) && is_object($GLOBALS['TSFE']->fe_user)) {
            // FE-user is already initialized - this can happen when we use/call internal REST-endpoints inside of a normal TYPO3-page
            $this->isFrontEndUserInitialized = true;
        }
        if ($this->isFrontEndUserInitialized === true) {
            return;
        }

        $tsfe = $this->getTsfe($pageId, $type);
        $tsfe->initFEUser();
        $this->isFrontEndUserInitialized = true;
    }