fixed relationships between entities to generate more appropriate db model, fixed circular reference issue when serializing it later to json