defined view_where function for books model
removed switch statements and actually pulled book data from the db