Added data integrity checks to controllers and updated packages libraries