api edit implementation