collect stats api
Updated docs, minor bugfixes