Added prereading for json vs xml