public JsonObject terminateExecution(JsonObject json) {
		
		// Validate parameters
		JsonValue executionJsonValue = json.get("execution");
		if ( executionJsonValue == null ) return new JsonObject().add("error", "Parameter execution is null");
		if ( !executionJsonValue.isObject() ) return new JsonObject().add("error", "Parameter execution isn't a json object");
		JsonObject executionJson = executionJsonValue.asObject();
		
		JsonValue executionIdValue = executionJson.get("id");
		if ( executionIdValue == null ) return new JsonObject().add("error", "Parameter id is null");
		if ( !executionIdValue.isNumber() ) return new JsonObject().add("error", "Parameter id isn't a string");
		int executionId = executionIdValue.asInt();
		
		// The execution is removed from the map
		ExecutionMap map = new ExecutionMap();
		Execution execution = map.pull(executionId);
		
		// In case the execution didn't exist, notify the client
		if ( execution == null )
			return new JsonObject().add("error", "The given execution wasn't being processed");
		
		// In case the execution is being processed right now by a worker
		if ( execution.getWorkerIP() != null ) {
			// Send termination request
			JsonObject message = new JsonObject();
			message.add("action", Action.TERMINATE_EXECUTION.getId());
			message.add("execution", new JsonObject().add("id", executionId));
			
			HttpSender sender = new HttpSender();
			sender.setDestinationIP( execution.getWorkerIP() );
			sender.setDestinationRole("worker");
			sender.setMessage(message);
			String response = null;
			try {
				response = sender.send();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return JsonObject.readFrom(response);
		}
		
		if ( "in progress".equals(execution.getStatus()) ) {
			execution.setStatus("terminated");
		}
		
		return new JsonObject().add("execution", execution.toJsonObject());
	}