unit test for the service layer

added unit test for the service layer