added validation and test code to food model