convert to JSON instead of plaintext refs #1