API: Rewrite ApiQueryTags to fix continuation

And while we're at it, may as well include an indicator of whether the
tag is defined.

Bug: T76051
Bug: T76052
Change-Id: If2569ba1414b5f38d49c5f3ce9b6ca9c1a58f1c2