Removing vanilla JS; the logic is now in the API