Moved most functions to Service, except authentication and getting stats