ending poll by using api, but I think the api doesn't work correctly