Add tests for key stats api