code: protected <T> T getDatamodelObjectFromResponse(JsonNode response, List<String> path, Class<T> targetClass) throws JsonProcessingException {
  		if(response == null) {
  			throw new JsonMappingException("The API response is null");
  		}
  		JsonNode currentNode = response;
  		for(String field : path) {
  			if (!currentNode.has(field)) {
  				throw new JsonMappingException("Field '"+field+"' not found in API response.");
  			}
  			currentNode = currentNode.path(field);
  		}
  		return mapper.treeToValue(currentNode, targetClass);
  	}
docs: Extracts a particular data model instance from a JSON response
  returned by MediaWiki. The location is described by a list of successive
  fields to use, from the root to the target object.
  
  @param response
  the API response as returned by MediaWiki
  @param path
  a list of fields from the root to the target object
  @return
  the parsed POJO object
  @throws JsonProcessingException