added JPA support and refactoring controllers
_