Add jsonencode to avoid errors with odd characters or injection of stuff into the JSON