implemented the EntityManager, tests pass