add entity manager to index controller