protected void showMainScreen(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException,
			UnsupportedEncodingException {
		// set the encoding, otherwise database is encoded wrongly
		request.setCharacterEncoding("UTF-8");

		HttpSession session = request.getSession();
		AdminUnitReportVM formData = (AdminUnitReportVM) session
				.getAttribute("formData");
		session.removeAttribute("errors");

		// if no viewmodel in session, then normally this is first call through
		// get
		// so check get parameters and populate viewmodel with data from dao
		if (formData == null) {
			Integer adminUnitTypeID = processAndValidateID(request);
			if (adminUnitTypeID == null) {
				adminUnitTypeID = 1;
			}
			formData = populateViewModelWithData(request, response,
					adminUnitTypeID);
		} else {
			// now we are in post

			if (backButtonWasPressed(request, response)) {
				return;
			}

			// clear info about last unit "Vaata" was pressed at
			formData.setChosenSubordinate(null);
			// see if "Vaata" was pressed again
			handleLookButtons(formData, request);

			// if no "Vaata" was pressed see if was refresh button
			if (formData.getChosenSubordinate() == null
					&& refreshButtonWasPressed(request)) {
				Boolean newDataNeeded = false;

				if (adminUnitTypeHasChanged(formData, request)) {
					Integer newAdminUnitTypeID = Integer.parseInt(request
							.getParameter("AdminUnitType_adminUnitTypeID"));
					formData.setAdminUnitType(new AdminUnitTypeDAO().getByID(
							newAdminUnitTypeID, ""));
					newDataNeeded = true;
				}

				if (searchDateHasChanged(formData, request)) {
					formData = setCustomDate(formData, request);
					newDataNeeded = true;
				}

				if (newDataNeeded) {
					formData = setUnitTypeSpecifics(formData);
				}
			}
		}

		// save the viewmodel for jsp dispatcher into session
		session.setAttribute("formData", formData);

		// call the dispatcher
		request.getRequestDispatcher("AdminUnitReportScreen.jsp").forward(
				request, response);
	}