Fix small issue with json deserialisation check

If the JSON deserialised properly it was assumed that the
json was a valid hash. However, that isn't the case for
when people post quoted strings.

This commit makes sure that the JSON is a valid hash first.