add count api
Merge pull request #20 from srethink/add_count_api

add count api