updated generateHtmlContent() and the query sent to backend