@GET
	@Path("/getMood")
	@Produces(MediaType.APPLICATION_JSON)
	public MoodResponse getMood(@QueryParam("startDate") String startDate,@QueryParam("endDate") String endDate,@QueryParam("userId") String userid ) {

		MoodResponse resp=new MoodResponse();
		if(startDate==null) return resp;
		if(endDate==null){
			endDate=Calendar.getInstance().toString();
		}
		try {
			DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
			Date sDate= formatter.parse(startDate);
			Date eDate= formatter.parse(endDate);
			
			ArrayList<Double> scores=new ArrayList<>();
			int facebook=0, twitter=0, foursquare=0, gcal=0;
			while(sDate.before(eDate) || sDate.equals(eDate)){
				
				TwitterDAO tw=new TwitterDAO();
				FoursquareDAO fsq=new FoursquareDAO();
				CalenderDAO cal=new CalenderDAO();
				FacebookDAO fb=new FacebookDAO();
				FBData fbData = null;
				TwitterData twData=null;
				FSQData fsqData=null;
				CalendarData calData=null;
				System.out.println("before get data for facebook..." + sDate);
				fbData=fb.getData(formatter.format(sDate),userid);
				twData=tw.getData(userid, formatter.format(sDate));
				fsqData=fsq.getData(userid, formatter.format(sDate));
				calData=cal.getData(userid, formatter.format(sDate));


				WSResponse response=new WSResponse();
				response.setDate(formatter.format(sDate));
				ArrayList<Events> events=new ArrayList<>();
				response.setEvents(events);
				response=addFBData(response,fbData);
				response=addTwitterData(response,twData);
				response=addFSQData(response,fsqData);
				response=addCalData(response,calData);
				
				facebook=facebook+response.getFacebook();
				foursquare+=response.getFoursquare();
				gcal+=response.getGcal();
				twitter+=response.getTwitter();
				
				if(response.getScore()>0){
					resp.setHappy(resp.getHappy()+1);
				}if(response.getScore()<0){
					resp.setSad(resp.getSad()+1);
				}else{
					resp.setMixed(resp.getMixed()+1);
				}
				
				scores.add(response.getScore());
				
				
				
				
				Calendar c = Calendar.getInstance();
				c.setTime(sDate);
				c.add(Calendar.DATE, 1);  // number of days to add
				startDate = formatter.format(c.getTime());
				sDate=formatter.parse(startDate);
			}
			resp.setScores(scores);
			resp.setFacebook(facebook);
			resp.setTwitter(twitter);
			resp.setGcal(gcal);
			resp.setFoursquare(foursquare);
		}catch (ParseException e) {
				e.printStackTrace();
			} catch (JSONException e) {
				e.printStackTrace();
			}
		return resp;
	}