[example] add an example
[doc] fix comment and update readme with example and api usage
[test] add test