add count by filter api