[webui] use :xpath for xpath queries
[api] remove unused flag controller

We'll do it directly later
[webui] move comments logic completely into webui