AJAX server side of creating new event.

Data format to AJAX is:

var data = {
  title: String,
  description: String,
  startDate: new Date(),
  endDate: new Date(),
  deadline: new Date(),
  duration: String, // or Number?
  participants: [String] // array of facebook ID
};

Example of AJAX:
$.post('/newevent', data);