sending arbitary JSON now works with error checking