Make sure the branch counter gets updated

**What does this PR do**
When you delete a branch, the counters wont get updated automaticly,
this happends because of the JS nature of the original call. I've
fixed this by responding with a JS file, and recalculate the counters.

**Relevant issue numbers**
Fixes: #6030