<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _GenApiConfigCallback(args, api_func=GenApiConfig):
 """Generate an api file. Args: args: An argparse.Namespace object to extract parameters from. api_func: A function that generates and returns an API configuration for a list of services. """

  service_configs = api_func(args.service,
                             hostname=args.hostname,
                             application_path=args.application)

  for api_name_version, config in service_configs.iteritems():
    _WriteFile(args.output, api_name_version + '.api', config)