Improve json error messages

The error message for invalid user-entered JSON was not very helpful. The new error message states that the parameter is invalid.