public Response serve( String uri, String method, Properties header, Properties parms, Properties files, Socket source ) {
		System.out.println("URI: " + uri);
		if (uri.length() > 1) {
			if (uri.charAt(0) == '/') {
				uri = uri.substring(1);
			}
		} else {
			return handleIndex();
		}

		String[] params = uri.split("/");
		System.out.println("params: " + Arrays.toString(params));

		if (params[0].equals("upvote")) {

			// DEBUG - FOR TESTING
			System.out.println("------------------");
			for (String ip : lastActionTime.keySet()) {
				System.out.println("ip in action map: " + ip);
			}
			System.out.println("------------------");

			InetAddress addr = source.getInetAddress();
			String sourceHost = addr.toString();
			System.out.println(sourceHost);

			// do not allow a user to upvote too often
			if (!lastActionTime.containsKey(sourceHost))  {
				lastActionTime.put(sourceHost, new Long(System.currentTimeMillis()));
			} else {

				long lastAction = lastActionTime.get(sourceHost);
				long currentTime = System.currentTimeMillis();

				// this client has sent an upvote within 30 seconds
				if (currentTime - lastAction < (UPVOTE_DELAY_SECONDS * 1000)) {
					return new NanoHTTPD.Response(HTTP_OK, MIME_HTML, "TMA");
				} else {
					lastActionTime.put(sourceHost, new Long(System.currentTimeMillis()));
				}
			}
			return handleUpvote(params);

		} else if (params[0].equals("search")) {
			if (params.length > 1) {
				return handleSearch(params[1].trim());
			}
			else {
				// Cheat for now for when no search results entered, I'll fix later...probably
				return new NanoHTTPD.Response(HTTP_OK, MIME_HTML, getMainPageData());
			}

		} else if (params[0].equals("reload")) {  // Returns basic page data when refresh is called
			return new NanoHTTPD.Response(HTTP_OK, MIME_HTML, getMainPageData());
		}
		return handleIndex();

	}