moved database access out of bookserver