[api] Add support for querying subcategories in the Api.