local function EnsureApiRegistry()
  local api = rawget(_G, "LIDCOUNCIL_API")
  if type(api) ~= "table" then
    api = {}
    _G.LIDCOUNCIL_API = api
  end
  -- A conflicting addon must not be able to poison LidCouncil's private registry.
  if type(api.__internal) ~= "table" then
    api.__internal = {}
  end
  return api, api.__internal
end

_G.LIDCOUNCIL_EnsureApiRegistry = EnsureApiRegistry
EnsureApiRegistry()
