Added validations and few rspec tests