modify js and html according to new API