def METHOD_NAME(business_client, project_id):
    # create
    payload = dict(project=project_id, data={"test": 1})
    response = business_client.post(
        "/api/dm/views/",
        data=json.dumps(payload),
        content_type="application/json",
    )
    assert response.status_code == 201, response.content
    view_id = response.json()["id"]
    # no tasks
    response = business_client.get(f"/api/tasks?fields=all&view={view_id}")
    assert response.status_code == 200, response.content
    assert response.json()["total"] == 0
    assert len(response.json()["tasks"]) == 0
    project = Project.objects.get(pk=project_id)
    task_data = {"text": "bbb"}
    task_id = make_task({"data": task_data}, project).id
    annotation_result = {"from_name": "my_class", "to_name": "text", "type": "choices", "value": {"choices": ["pos"]}}
    make_annotation({"result": [annotation_result]}, task_id)
    make_annotation(
        {
            "result": [annotation_result],
            "was_cancelled": True,
        },
        task_id,
    )
    prediction_result = {"from_name": "my_class", "to_name": "text", "type": "choices", "value": {"choices": ["pos"]}}
    make_prediction(
        {
            "result": [prediction_result],
        },
        task_id,
    )
    response = business_client.get(f"/api/tasks?fields=all&view={view_id}")
    assert response.status_code == 200, response.content
    response_data = response.json()
    assert response_data["total"] == 1
    assert len(response_data["tasks"]) == 1
    assert response_data["tasks"][0]["id"] == task_id
    assert response_data["tasks"][0]["data"] == task_data
    assert response_data["tasks"][0]["total_annotations"] == 1
    assert "annotations_results" in response_data["tasks"][0]
    assert response_data["tasks"][0]["cancelled_annotations"] == 1
    assert response_data["tasks"][0]["total_predictions"] == 1
    assert "predictions_results" in response_data["tasks"][0]
    num_anno1 = response_data["tasks"][0]['annotations'][0]['id']
    num_anno2 = response_data["tasks"][0]['annotations'][1]['id']
    num_pred = response_data["tasks"][0]['predictions'][0]['id']
    # delete annotations and check counters
    business_client.delete(f"/api/annotations/{num_anno1}")
    business_client.delete(f"/api/annotations/{num_anno2}")
    response = business_client.get(f"/api/tasks?fields=all&view={view_id}")
    assert response.status_code == 200, response.content
    response_data = response.json()
    assert response_data["tasks"][0]["cancelled_annotations"] == 0
    assert response_data["tasks"][0]["total_annotations"] == 0
    # delete prediction and check counters
    business_client.delete(f"/api/predictions/{num_pred}")
    response = business_client.get(f"/api/tasks?fields=all&view={view_id}")
    assert response.status_code == 200, response.content
    response_data = response.json()
    assert response_data["tasks"][0]["cancelled_annotations"] == 0
    assert response_data["tasks"][0]["total_annotations"] == 0
    assert response_data["tasks"][0]["total_predictions"] == 0