Add validation and Unit tests