Refactor service
Add JSON service endpoint