chaining some promises. view/edit mode, sort of