Fix associations and add hmt rltns and join table