Checking that the data is a valid json string before parsing it.
Dotted changed to dashed.