refactored repositories to use EntityManager. TODO: implement Repository.findAll()