Added baseclass that handles basic validation for models according to an input.