handle json formatted errors returned by opentree api