separate api and cli