public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {

		pm = Common.getPM();		
		//getBuses();
		try {
			User googler = Common.getGoogleUser();

			if (googler == null)
				resp.sendRedirect(Common.getGoogleLoginUrl());
			else {
				resp.setContentType("text/html");
				PrintWriter out = resp.getWriter();
				u = LinkedUser.loadOrCreate(pm, Common.getGoogleUser().getUserId());
				FoursquareApi api = null;
				if (u.foursquareAuth() != null) {
					api = Common.getApi(u.foursquareAuth());
				} else {
					code = req.getParameter("code");
					log.info(code);
					if (code != null) {
						api = Common.getApi();
						try {
							api.authenticateCode(code);
							if (api.getOAuthToken() != null) {
								u = LinkedUser.loadOrCreate(pm, Common.getGoogleUser().getUserId());
								u.foursquareAuth = api.getOAuthToken();
								getUserID(u.foursquareAuth);
								u.save(pm);
							} else
								api = null;
						} catch (FoursquareApiException e) {
							log.warning(e.toString());
							api = null;
						}
					}

				}

				if (api == null || api.getOAuthToken() == null || api.getOAuthToken().length() <= 0) {
					writeHead(out, "Connect to foursquare");
					writeConnectPrompt(out);
					writeFoot(out, null, null);
				} else {
					writeHead(out, "Welcome to " + Common.TARGET_VENUE_NAME);
					writePage(out, Common.TARGET_VENUE_NAME);
					writeFoot(out, Common.TARGET_VENUE,
							Common.createChannelToken(Common.TARGET_VENUE));
				}
			}
		} finally {
			pm.close();
		}
	}