updated parsing code to deal with new json format