Avoiding JSON parse problems on the client side