public void doGet(final HttpServletRequest servletRequest, final HttpServletResponse servletResponse)
			throws ServletException, IOException {

		final String commandName = servletRequest.getParameter("command");

		System.out.println("COMMAND NAME " + commandName);

		if (commandName != null && !commandName.isEmpty()) {
			if (commandName.equals(AJAX_CMD_LOAD_LIBRARIES)) {

				Collection<Library> libraries = libraryDelegate.getAllLibraries();

				servletResponse.setContentType("application/json");

				servletResponse.getWriter().write(jsonConverter.toJson(libraries));

			} else if (commandName.equals(AJAX_COMMAND_ALLOCATE_BOOKS)) {
				String title = null;

				if (servletRequest.getParameter("book_title") != null
						&& !servletRequest.getParameter("book_title").isEmpty()) {
					title = servletRequest.getParameter("book_title");

				}
				int qty = 0;
				if (servletRequest.getParameter("book_Qty") != null
						&& !servletRequest.getParameter("book_Qty").isEmpty()) {
					qty = Integer.parseInt(servletRequest.getParameter("book_Qty"));

				}
				Collection<Library> library = libraryDelegate.allocateBooks(title, qty);
				servletResponse.setContentType("application/json");

				servletResponse.getWriter().write(jsonConverter.toJson(library));

			}
		}

	}