mainService and some tests added