public JsonObject newActivity( JsonObject json ) {
		
		// Get and validate parameters
		JsonValue activityJsonValue = json.get("activity");
		if ( activityJsonValue == null ) return new JsonObject().add("error", "Parameter activity is null");
		if ( !activityJsonValue.isObject() ) return new JsonObject().add("error", "Parameter activity isn't a json object");
		JsonObject activityJson = activityJsonValue.asObject();
		
		JsonValue nameValue = activityJson.get("name");
		if ( nameValue == null ) return new JsonObject().add("error", "Parameter name is null");
		if ( !nameValue.isString() ) return new JsonObject().add("error", "Parameter name isn't a string");
		String name = nameValue.asString();
		
		JsonValue installationScriptLocationValue = activityJson.get("installationScriptLocation");
		if ( installationScriptLocationValue == null ) return new JsonObject().add("error", "Parameter installationScriptLocation is null");
		if ( !installationScriptLocationValue.isString() ) return new JsonObject().add("error", "Parameter installationScriptLocation isn't a string");
		String installationScriptLocation = installationScriptLocationValue.asString();
		
		// Create activity object
		Activity activity = new Activity();
		activity.setName(name);
		activity.setInstallationScriptLocation(installationScriptLocation);
		activity.setStatus("verifying");
		
		// Insert object in persistent information storage (database)
		ActivityDAO adao = new ActivityDAO();
		int activityId = adao.insert(activity);
		
		// Prepare response object
		JsonObject jsonResponse = new JsonObject();
		
		// Some error happened
		if ( activityId < 0 ) {
			
			if( adao.getError().contains("Duplicate entry") ){
				return jsonResponse.add("error", "The activity name "+name+" already exists");
			}
			return jsonResponse.add("error", "Error creating the activity "+name+", retrieved id is "+activityId);
		}
		
		// Launch a thread that for every worker, sends a request to perform the installation
		new Thread ( new ActivityInstallationNotifier(activity, Action.INSTALL_ACTIVITY ) ).start();
		
		// No error happened
		return jsonResponse.add("activity", activity.toJsonObject()).add("status", "installing");
	}