created models and defined relationships