Fix main views to use ForeignKey relationship