add count-by-value to api