fixed #19 Created Validator for checking data and throwing exceptions.