major API refactor to switch from Hibernate entity manager to Hibernate sessions and fix connection pooling