add reset stats function
make it invalid to send stats that are not registered
improve api
Merge pull request #6 from CapillarySoftware/refactor_api

Refactor api