Added check for string rather than JSON to make it easier to switch between clients