simplify parseJson + better output of the error