added database functionality for books