@GET
	@Produces(MediaType.APPLICATION_JSON)
	@Path("/topPerformers/{name}") 
	public List<LeaderBoardEntry> getTopPerformers(@PathParam("name") String name) {
		List<LeaderBoardEntry> users = new ArrayList<LeaderBoardEntry>();

		DatastoreService ds = DatastoreServiceFactory.getDatastoreService();

		Query query = new Query("UserActivity");

		Date today = new Date();	  
		Filter activityDateFilterLessThan = new Query.FilterPredicate("activityDate", FilterOperator.LESS_THAN_OR_EQUAL, Utils.convertDateToLong(today));
		query.setFilter(activityDateFilterLessThan);

		Map<String, Double> userDistanceCovered = new HashMap<String, Double>();
		List<Entity> results = ds.prepare(query).asList(FetchOptions.Builder.withDefaults());
		for(Entity result: results) {

			String userName = ((Key) result.getProperty("userName")).getName();

			Double totalDistaceCovered = 0.0;
			if(userDistanceCovered.get(userName) != null)
				totalDistaceCovered = userDistanceCovered.get(userName);
			totalDistaceCovered += (Double) result.getProperty("distanceCovered");

			userDistanceCovered.put(userName, totalDistaceCovered);
		}

		Map<String, Double> sortedMap = Utils.sortMapOnValues(userDistanceCovered);

		boolean userOnLeaderBoard = false;
		List list = new LinkedList(sortedMap.entrySet());		
		System.out.println(list);
		for (int i=list.size()-1, j=1; i>=list.size()-3 && i>=0; i--, j++) {
			Map.Entry entry = (Entry) list.get(i);
			String userName = (String) entry.getKey();
			users.add(new LeaderBoardEntry(userName, userDistanceCovered.get(userName), j));
			if(name.equalsIgnoreCase(userName)) {
				userOnLeaderBoard = true;
			}
		}

		if(!userOnLeaderBoard) {

			boolean userHasActivity = false;
			for (int i=list.size()-1, j=1; i>=0; i--, j++) {
				Map.Entry entry = (Entry) list.get(i);
				String userName = (String) entry.getKey();
				if(name.equalsIgnoreCase(userName)) {
					users.add(new LeaderBoardEntry(userName, userDistanceCovered.get(userName), j));
					userHasActivity = true;
				}
			}

			if(!userHasActivity)
				users.add(new LeaderBoardEntry(name, 0.0, -1));
		}

		return users;		
	}