@RequestMapping(value = "/init", method = RequestMethod.GET)
  public String init(ModelMap model) {

    if (studentSystem == null) {
      model.addAttribute("message", "Error filling in data. studentSystem == null");
    } else {
      int john = studentSystem.addStudent("John McClane");
      int jane = studentSystem.addStudent("Jane Fonda");
      int inf5750 = studentSystem.addCourse("INF5750", "Open Source Development");
      int inf5761 = studentSystem.addCourse("INF5761", "Health management information systems");

      int master = studentSystem.addDegree("Master");
      int bachelor = studentSystem.addDegree("Bachelor");
      int phd = studentSystem.addDegree("PhD");

      studentSystem.addAttendantToCourse(inf5750, john);
      studentSystem.addAttendantToCourse(inf5750, jane);
      studentSystem.addAttendantToCourse(inf5761, john);
      studentSystem.addAttendantToCourse(inf5761, jane);

      studentSystem.addRequiredCourseToDegree(master, inf5761);

      model.addAttribute("message", "Filled in data OK");
    }

    model.addAttribute("message", "Filling in data");

    populateModel(model);
    return "index";
  }
  @RequestMapping(value = "/degree/{degreeId}/requiredcourse", method = RequestMethod.POST)
  public String addRequiredCourse(
      ModelMap model,
      @PathVariable("degreeId") int degreeId,
      @RequestParam("courseid") int courseId) {

    logger.debug("Adding required course " + courseId + " in degree " + degreeId);
    studentSystem.addRequiredCourseToDegree(degreeId, courseId);
    populateModel(model);
    return "degree";
  }