Improve new document creation

Make sure we refresh the navigation bar only after the document and the navigation has been saved on the server.