made counter api better
renamed counter api, added docs, added error handling