use json iinstead xml in sample code
remove remnant use of pcall