add a reference api for testing code generation