creates models and implements associations between all models