Fix up and validate JSON for /api/messages/latest