course_id parsing middleware