Data Integrity

Implemented fundamental integrity and error checking in the data model.