public function api(array $options = [], $fromGenerate = false)
    {
        if (!$fromGenerate) {
            $this->generate();
        }

        $templatesPath = $this->templatesPath;
        if (null === $templatesPath) {
            // fallback
            $templatesPath = \dirname(__DIR__).'/templates';
        }

        $documentator = new Documentation($this->files, $this->config, $templatesPath, $options);
        $documentator->setLogger($this->logger);

        $this->logger->info('Generating API into '.$documentator->getOutputDirectory());
        $documentator->build();
    }