use the new api endpoints
factorise all html