Service test added and fixed some bugs