Support uid query in count endpoint