Moved SQL queries from frontend views into models.
Added disabled backref.