Refactor document deletion to be more consistent.
Bump api to latest