Fix tests, add a stats api
A commit'