Validate input to lending books and document code