convert from json to array of object