Adding validation and test

Added validations and test to database entries