Added ORM part and fixed hasMany & belongsTo