first pass at json writing