api_generator: add singleton interface