pass ctx and api stub