rewrote getBook handler to split document into lines