Parsing json for device events