support both json and xml