fix: handle non-json responses
In some situations, a server might respond with an unexpected format. Address this for json expectations.
Edited by Sacha Brants
In some situations, a server might respond with an unexpected format. Address this for json expectations.