break;

 case 'detail':
   if ($id = $_REQUEST['id']) {
     $event = MIT_Calendar::getEvent($id);
     $data = clean_up_event($event);
   }
   break;

 case 'category': // get events in a single category
   if ($id = $_REQUEST['id']) {
     $start = isset($_REQUEST['start']) ? $_REQUEST['start'] : time();
     $end = isset($_REQUEST['end']) ? $_REQUEST['end'] : $start + 86400;
     $start = date('Y/m/d', $start);
     $end = date('Y/m/d', $end);
     $events = MIT_Calendar::HeadersByCatID($id, $start, $end);
   }

   foreach ($events as $event) {
     $data[] = clean_up_event($event);
   }
   break;

 /* getting events in a single category is the same
  * as using search with an additional category parameter
  */
 case 'search':
   require_once LIBDIR . "AcademicCalendar.php";
   $searchTerms = isset($_REQUEST['q']) ? $_REQUEST['q'] : '';
   /*
   $category = isset($_REQUEST['category']) ?