Added Statistics command to the web-api.
Worked more on stats.
Refactored stats a bit.