abstract api html to templates