Check if json is valid