new api and delete function changes