Implemented Counter API, fixes #25