Add aggregate function tagging in query API