some fixes of exception handling and generating DB PK by hibernate.
some validation improvements.