add service function (not finished)