link generation and validation functionality