I have a function that does request to API when the video is finished:

```
 video.addEventListener('ended', example);
 var example = function () {
   VK.api('video.get', { owner_id: 123 }, function(data) { 
     /**...*/ 
   }
 }

```

And also I have a replay button (shows when video is finished), which the user can click faster than the response comes from API. And now I need to kill my function. How I can do it?

Link to API: <https://vk.com/dev/video.get>