GetStats API function (untested)