XML to JSON update

changed serverside encoding to JSON, updated handling here