protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException 
	{
		UserManager UM = new UserManager(ds);
		String path = req.getRequestURI();
		String[] pathComponents = path.split("/");
		ArrayList<UserDetails> userList = new ArrayList<UserDetails>();
		boolean querySuccess = false;
		
		//
		// If the user doesn't supply enough arguments then set bad request and return
		if(pathComponents.length < 3)
		{
			resp.setStatus(HttpServletResponse.SC_BAD_REQUEST);
			return;
		}
		
		//
		// If there is a bad path, set bad request and return
		if(!pathComponents[2].equals("user"))
		{
			resp.setStatus(HttpServletResponse.SC_BAD_REQUEST);
			resp.setContentLength(0);
			resp.setContentType("text/plain");
			return;
		}
		
		if(pathComponents[3].equals("getallusers"))
		{
			
			userList = UM.fetchAllUsers();
			
			if(userList.size() > 0)
			{
				String json = ListTransformer.returnUsersFromArrayList(userList);
				
				
				PrintWriter output = resp.getWriter();
				
				resp.setContentType("application/json");
				output.write(json);
				querySuccess = true;
			}
		}
		
		//Set a user and a friend
		//
		if(pathComponents[3].equals("addfriend"))
		{
			int currentUser = Integer.parseInt(pathComponents[4]);
			int newFriend = Integer.parseInt(pathComponents[5]);
			
			querySuccess = UM.setFriend(currentUser, newFriend);
		}
		
		/*
		 * This must return the friends of the person in JSON format
		 * If no friend is found, return 0.
		 */
		if(pathComponents[3].equals("findfriends"))
		{
			int currentUser = Integer.parseInt(pathComponents[4]);
			
			userList = UM.fetchAllFriendsById(currentUser);
			
			if(userList.size() !=0)
			{
				String json = ListTransformer.returnUsersFromArrayList(userList);
				
				PrintWriter output = resp.getWriter();
				
				resp.setContentType("application/json");
				output.write(json);
				querySuccess = true;
			}else 
			{
				PrintWriter output = resp.getWriter();
				resp.setContentType("application/json");
				output.write("0");
			}
		}
			
		// If we register a problem, it will relate to stuff not being found so send back a 404 resource not found
		//
		if(querySuccess == false)
		{
			resp.setStatus(HttpServletResponse.SC_NOT_FOUND);
			resp.setContentLength(0);
			resp.setContentType("text/plain");
		}	
	}