Emit JSON instead of just a string for UI