code: function (project, parameters, callback) {
              var deferred = Q.defer(),
                  rawJson;
  
              getRootHash(project, parameters || {})
                  .then(function (rootHash) {
                      return Q.all([
                          _collectObjectAndAssetHashes(project, rootHash),
                          project.getProjectInfo()
                      ]);
                  })
                  .then(function (res) {
                      var hashes = res[0],
                          info = res[1];
                      rawJson = {
                          rootHash: parameters.rootHash,
                          projectId: project.projectId,
                          kind: typeof parameters.kind === 'string' ? parameters.kind : info.info.kind,
                          branchName: parameters.branchName,
                          commitHash: parameters.commitHash,
                          hashes: hashes,
                          objects: null
                      };
                      return _collectObjects(project, hashes.objects);
                  })
                  .then(function (objects) {
                      rawJson.objects = objects;
                      deferred.resolve(rawJson);
                  })
                  .catch(deferred.reject);
  
              return deferred.promise.nodeify(callback);
          }
docs: Extracts a serializable json representation of a project tree.
  To specify starting point set one of the four options. If more than one is set the order of precedence is:
  branchName, commitHash, tagName and rootHash.
  
  @param {ProjectInterface} project
  @param {object} parameters - Specifies which project tree should be serialized:
  @param {string} [parameters.rootHash] - The hash of the tree root.
  @param {string} [parameters.commitHash] - The tree associated with the commitHash.
  @param {string} [parameters.tagName] - The tree at the given tag.
  @param {string} [parameters.branchName] - The tree at the given branch.
  @param {string} [parameters.kind] - If not given will assign the one in project.
  @param {function} callback