Add logic to JS frontend.