Updated code, added sample JSON structure