Since you've got only one place for the data to go, just move the `api()` call to the JS and out of the template.