Refactor checkHtmlFile() and adjust restler callback