finishing up the base of the entity framework. it has race conditions atm. will be fixed later