public String getCustomEvents(String username, boolean onlyCustomEvents, String fromCalendar) {
		try {
			if(onlyCustomEvents) {
				events.events.clear();
				pstmt = doQuery("SELECT * FROM events WHERE active = true AND calendar = ? AND calendar IN (SELECT calendar FROM calendars WHERE active = true AND (isPublic = true OR calendar IN (SELECT calendar FROM usercalendars WHERE username = ?)))");
				pstmt.setString(1, fromCalendar);
				pstmt.setString(2, username);
				rs = pstmt.executeQuery();
			} else {
				pstmt = doQuery("SELECT * FROM events WHERE active = true AND calendar IN (SELECT calendar FROM calendars WHERE active = true AND (isPublic = true OR calendar IN (SELECT calendar FROM usercalendars WHERE username = ?)))");
				pstmt.setString(1, username);
				rs = pstmt.executeQuery();
			}
			while(rs.next()) {
				try {
					String eventid = rs.getString("eventID");
					String type = rs.getString("eventType");
					String description = rs.getString("description");
					String location = rs.getString("location");
					String start = rs.getString("start");
					String end = rs.getString("end");

					events.events.add(new Event(null, eventid, type, description, location, null, null));

					int size = (events.events.size())-1;

					Date dateStart = new SimpleDateFormat("yyyy-MM-dd HH:mm").parse(start);

					Date dateEnd = new SimpleDateFormat("yyyy-MM-dd HH:mm").parse(end);
					events.events.get(size).setStartdate(dateStart);
					events.events.get(size).setEnddate(dateEnd);
				} catch (ParseException e) {
					e.printStackTrace();
				}
			}
		} catch (SQLException e) {
			e.printStackTrace();
		} finally {
			try {
				rs.close();
				pstmt.close();
				conn.close();
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}
		if(onlyCustomEvents) {
			return gson.toJson(events);
		} else {
			events = noteModel.getNotes(events);
			return null;
		}

	}