Implement APIs for the counter extension

`Data structure to...`