added delete function to api