Make API model independent from hibernate libs. Close #102.