@Override
    public void process(Request request, TreeNode<Resource> resultNode, String href) {
      if (href.contains("/mpacks/")) {
        ResourceImpl mpack = (ResourceImpl) resultNode.getObject();
        Map<String, Map<String, Object>> mapInfo = mpack.getPropertiesMap();
        Map<String, Object> versionInfo = mapInfo.get("Versions");

        int idx = href.indexOf("mpacks/");
        String stackName = (String)versionInfo.get("stack_name");
        String stackVersion = (String)versionInfo.get("stack_version");
        href = href.substring(0, idx) + "stacks/" + stackName + "/versions/" + stackVersion;
        resultNode.setProperty("href", href);
      } else {
        super.process(request, resultNode, href);
      }
    }
Post Processing the mpack href when the call comes from stack endpoint to ensure that the
href is a backreference to the mpacks end point
ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackVersionResourceDefinition.java