Added service layer; added unit tests;