public JSONObject toJson(long uid) throws Exception {
		JSONObject apptJo = new JSONObject();
		apptJo.put("id", this.getId());
		apptJo.put("initiator", User.findById(this.initiatorId).toJson());
		apptJo.put("name", this.name);
		apptJo.put("venueId", this.venueId);
		apptJo.put("startTime", this.startTime);
		apptJo.put("endTime", this.endTime);
		apptJo.put("info", this.info);
		apptJo.put("frequency", this.frequency);
		apptJo.put("lastDay", this.lastDay);
		if (uid >= 0)
			apptJo.put("reminderAhead", this.getReminderAhead(uid));
		apptJo.put("isJoint", this.isJoint);

		if (this.isJoint)
		{
			apptJo.put("aWaiting", User.listById(WrapperUtil
					.toArray(this.aWaitingId)));
			apptJo.put("aAccepted", User.listById(WrapperUtil
					.toArray(this.aAcceptedId)));
			apptJo.put("aRejected", User.listById(WrapperUtil
					.toArray(this.aRejectedId)));

		}

		return apptJo;
	}