added validations and unit tests
and a fixture to use for testing