added basic JSON writing capabilities