private void registerAsBackend(BufferedReader br,
				HTTPResponseHandler hrh) {
			try {
				/*
				 * If the post request contains body, read it in, Otherwise,
				 * return a 400 Bad Request
				 */
				if (br.ready()) {
					char[] bodyChars = new char[1000];
					br.read(bodyChars);
					StringBuffer sb = new StringBuffer();
					sb.append(bodyChars);
					String postBody = sb.toString().trim();

					JSONParser jp = new JSONParser();
					JSONObject requestBody = (JSONObject) jp.parse(postBody);

					String ipAddrs = requestBody.get("ipAddrs").toString();
					int portNum = Integer.valueOf(requestBody.get("portNum")
							.toString());
					int dataserverID = discoveryData.getDataserverID();
					
					JSONObject newBackEndObject = new JSONObject();
					newBackEndObject.put("dataserverID", dataserverID);
					newBackEndObject.put("ipAddrs", ipAddrs);
					newBackEndObject.put("portNum", portNum);

					JSONArray currentBackEndsArray = discoveryData
							.getBackEndsArray();

					/*
					 * Notify all data servers about the new backend
					 */
					for (int i = 0; i < currentBackEndsArray.size(); i++) {
						JSONObject eachBackEnd = (JSONObject) currentBackEndsArray
								.get(i);
						String eachBackEnd_ipAddrs = eachBackEnd.get("ipAddrs")
								.toString();
						int eachBackEnd_portNum = Integer.valueOf(eachBackEnd
								.get("portNum").toString());
						try {
							Socket notifySocket = new Socket(
									eachBackEnd_ipAddrs, eachBackEnd_portNum);

							BufferedWriter wr = new BufferedWriter(
									new OutputStreamWriter(
											notifySocket.getOutputStream()));

							String path = "/notifyNewBackend";
							wr.write("POST " + path + " HTTP/1.1\r\n");
							wr.write("\r\n");
							wr.write(newBackEndObject.toString());
							wr.flush();
							wr.close();
							notifySocket.close();
						} catch (IOException e) {
							logger.debug(e.getMessage(), e);
						}
					}
					
					// Add new backend to backEndsArray
					discoveryData.addBackEnd(ipAddrs, portNum);

					// Response to new backend
					JSONObject currentPrimary = discoveryData
							.getCurrentPrimary();

					JSONObject responseBody = new JSONObject();
					responseBody.put("dataserverID", dataserverID);
					responseBody.put("currentPrimary", currentPrimary);
					responseBody.put("currentBackEndsArray",
							currentBackEndsArray);

					hrh.response(200, "OK", responseBody.toString());
					logger.info("Register successfully!");
				} else {
					hrh.response(400, "Bad Request",
							"Front End do not post anything!");
					logger.info("Post request body is empty!");
				}
			} catch (IOException e) {
				logger.debug(e.getMessage(), e);
			} catch (ParseException e) {
				logger.debug(e.getMessage(), e);
			}
		}