parse json apppropriately