Add validation and basic tests