api_generator: generalize result_converter for supported api_styles