def METHOD_NAME(self, session, id, message='', **params):
    api_job = session.api_job(id)
    if not api_job:
        message = "No job found!"
    elif api_job.cancelled:
        message = "This job has already been deleted."
    else:
        api_job.cancelled = datetime.now()
    raise HTTPRedirect('api_jobs?message={}', message or 'API job deleted.')