code: def get(self, id=None, project_id=None):
          
          logs_limit = request.args.get('logs_limit', default=-1, type=int)
  
          project = db.session.query(Project).filter_by(
              id=project_id).first()
          if project is None:
              return jsonify({
                  'project': None,
                  'message': 'No interface defined for URL.'
              }), 404
  
          if id is None:
              path = request.args.get('path_name', default=None)
              if path is not None:
                  result = db.session.query(Result).filter_by(
                      path_name=path).first()
                  if result is None:
                      return jsonify({
                          'result': None,
                          'message': 'Result path \'%s\' is not found' % path
                      }), 400
                  return jsonify({'result': result.serialize})
  
              collect_results(project)
  
              results = db.session.query(Result).\
                  filter_by(project_id=project_id).\
                  filter_by(is_unregistered=False).\
                  all()
  
              # NOTE: To improve performance, aggregate commit phase. By set
              # `commit=False`, implicit transaction is not closed, UPDATE query
              # is not committed. Consequently a process of serializing does not
              # have to call SELECT query again.
              for result in results:
                  crawl_result(result, commit=False)
              db.session.commit()
              rs = [r.serialize_with_sampled_logs(logs_limit) for r in results]
  
              return jsonify({'results': rs})
  
          else:
  
              result = db.session.query(Result).\
                  filter_by(id=id).\
                  filter_by(is_unregistered=False).\
                  first()
  
              if result is None:
                  return jsonify({
                      'result': None,
                      'message': 'No interface defined for URL.'
                  }), 404
  
              result = crawl_result(result)
  
              return jsonify({
                  'result': result.serialize_with_sampled_logs(logs_limit)
              })
docs: get.