adding Service class and ping method