fix res_json for more security. most of code is copied from Ark and Amon2
add xslate settiong