Implement capability delete

Signed-off-by: Alin Dreghiciu <adreghiciu@gmail.com>
Fix wrongly changed code (refactoring did too much)

Signed-off-by: Alin Dreghiciu <adreghiciu@gmail.com>