Handle case where server responds with 204 No Content

If the server responds with 204 No Content, then jquery passes an
object to the success handler, instead of the string you'd expect.
We therefore need to check that what we're asked to parse is indeed
a string.