refactored to use independent services and display some debug json data