I understand that this is only to aid debugging, but we probably ought to parse the JSON rather than do a string search. I can only imagine the possible error messages containing `ok`.... `{'error': 'Your cooking is rancid'}` ...  (or more sensibly `{'error': 'Invalid token'}`...)