changed some things to handle new json format