new api for edit