Encode JSON manually.