moved json responses to the service (reusable)