added some validation and testes using fixtures