Make use of the APIEditBeforeSave hook for nicer errors

Bug: 32216
Change-Id: I654eb21faffa1371f637d98d0fcd38c005048507
Merge "Make use of the APIEditBeforeSave hook for nicer errors"