Test/service

started writing tests and decided to refactor some stuff, didnt change branches, sorry, pr'ing what i have so others can view the latest.