Add delete function and update the json file