Using Service as a class and defining behavior by calling the class level api