Add relations between models
Add some controller functions