def METHOD_NAME(changed_api_files):
  """Detect changed modules based on changed API files."""
  all_modules = module_info()
  changed_modules = {}
  for file_path in changed_api_files:
    for k, v in all_modules.items():
      if v['root_dir'] and v['root_dir'] in file_path:
        changed_modules[k] = v
        break
  logging.info(f'changed_modules:\n{json.dumps(changed_modules, indent=4)}')
  return changed_modules