added validation for cases and created in-memory case repositiory