Added JPA annotations and some minor changes