code: public static JsonNode getFirstNode(final String text, final String path) {
          try {
              JsonNode node = mapper.readValue(text, JsonNode.class);
              if (path != null) {
                  node = (JsonNode) getElement(node, path);
              }
              return node;
          } catch (final IOException e) {
              logger.error("Cannot get first node", e);
          }
          return null;
      }
docs: Return the first node of a JSON response.
  
  @param text JSON text
  @param path path to find the first node
  @return the first node of the JSON response or null if exception is thrown