use json dumps for string escaping