example of safely using delete method wth $http