Refactor to use "id" instead of "key" for consistency with other APIs