Missing try / catch... yes that'll get a bit repetitive if you do it everywhere that it's needed, yes you should factor out a function to use in those many places... unless you just want to very pointedly note in your accompanying text that the JSON parsing in here isn't normative / safe.