migrating to rest services and hibernate