added hibernate fixes and service layer