api_generator: add generator test
api_generator: add function