add new API: edit resource.