made json encode HTML-safe