Better json write behavior in main app.