When I visit http://en.m.wikipedia.beta.wmflabs.org/wiki/Special:Gather/id/578/B3
a flag icon shows.
When clicked it fires an event to EventLogging
Instead it should hit the flagging API using http://localhost:8888/w/index.php/Special:ApiSandbox?useformat=desktop#action=editlist&format=json&id=119&mode=flag
To simplify implementation, the flag icon can always show, given that the api determines whether the action is allowed or not.