updating model and adding more basic functionality

fixed several JPA issues