added some json parsing