wrote logic for courses controller and route