protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		PrintWriter out = response.getWriter();
		JSONObject jso = new JSONObject();
		response.setContentType("application/json");
		try {
		if (request.getParameter("action") == null)
			return;
		else if (request.getParameter("action").equals("getWeek")) {
			if(request.getParameter("department") != null) {
				int department = Integer.parseInt(request.getParameter("department"));
				int section = Integer.parseInt(request.getParameter("section"));
				int semester = Integer.parseInt(request.getParameter("term"));
				SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
				Date date = format.parse(request.getParameter("date"));
				java.sql.Date sqlDate = new java.sql.Date(date.getTime());
					// id is null, as we do not know the timeslot..
			    	TimeTable stdl = new TimeTable( sqlDate, 0, section, department, semester);
					stdb.readObject(stdl);
                  
				jso.put("status", true);
				jso.put("status_code", 0);
				jso.put("status_message", " API success");
				jso.put("timeSlots", stdl.getJSon());
			}
		} else if(request.getParameter("action").equals("myTimetable")) {
			if(request.getParameter("date")!=null && request.getParameter("userId") != null){
				Person per = PersonFactory.getPersonFromEmail(request.getParameter("userId"));
				SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
				Date date = format.parse(request.getParameter("date"));
				java.sql.Date sqlDate = new java.sql.Date(date.getTime());
			//	int week=Integer.parseInt(request.getParameter("week"));
			TimeTables sdt2= new TimeTables(sqlDate, per.getId());
			stdb.readObject(sdt2);
			
			jso.put("status", true);
			jso.put("status_code", 0);
			jso.put("status_message", " API success");
			jso.put("teacherTimetable", sdt2.getJSon());
			
			}
		}
		

			} catch (ProvisionException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				jso.put("status", false);
				jso.put("status_code", e.getErrorCode());
				jso.put("status_message", e.getErrorMessage());
			} catch (ParseException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
			String callbackName = request.getParameter("callback");
			response.setContentType("application/json");
			out.println(callbackName + "(" + jso.toString() + ")");

		// TODO Auto-generated method stub
	}