So the server-side response sometimes returns a string? It might be best to just change the server-side API handlers to be consistent in what they return.