Mechanism of adding a book to the library with data validation implemented