refactor JSON result serialization

DTOs are now used in both directions, and JSON serialization is entirely
encapsulated within the REST module.