Fix support for both json and xml