@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		com.google.appengine.api.datastore.DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
		HttpSession session = req.getSession();
		try {
			//Get current logged in user Entity
			Entity e = ds.get(new Entity("User", (String)session.getAttribute("email")).getKey());
			//Get key of Entity(kind: User, key: new friends key)
			Key key = new Entity("User", req.getParameter("friend")).getKey();
			//Current number of friends
			int numFriends = (int) e.getProperty("numFriends");
			//Get current list of friends from user
			EmbeddedEntity m = (EmbeddedEntity)e.getProperty("friends");
			//Add new friend to friend list at position numFriends (because friends list starts from 0)
			m.setProperty(String.valueOf(numFriends), key);
			//Give new friends list to user Entity
			e.setProperty("friends", m);
			//Update number of friends for user Entity
			e.setProperty("numFriends", numFriends++);
			//Update user Entity in database
			ds.put(e);
		} catch (EntityNotFoundException ex) {
			ex.printStackTrace();
		}
	}