working code for parsing json objects