JSON write mode applying #2, incomplete