[WIP] Automate buttons

Avoid DOM id conflict by prefixing AE endpoint selection buttons.

This depends on #1077 and has to be rebased once #1077 is merged.

However it can be tested and reviewed separately @h-kataria : the last commit is the one relevant to this issue.