misreading JSON leads to KeyError