Added temporal count queries in API