transferred some methods for generatingJson to the service layer