adds validations and constraints on books