server side logic to handle jobs cancellation