wiring up to the api on index.html