Add create document helper on server, and some tests