created database models and set up connection to database