Changed the relationships in the database. Added repository pattern and unit of work.