Various client fixes and fixed an issue where we were returning string error messages instead of json error messages.