old_contents: import queries
  
  from utils import crossdomain
  from flask import Flask, jsonify
  
  app = Flask(__name__)
  app.debug = True
  
  def index_name(user, repo):
      return '-'.join((user, repo))
  
  
  # api endpoints that call the queries
  
  @app.route('/<user>/<repo>/most_active_people')
  @crossdomain(origin='*')
  def most_active_people(user, repo):
      index = index_name(user, repo)
      data = queries.most_active_people(index)
      return jsonify(data=data)
  
  @app.route('/<user>/<repo>/total_events_monthly')
  @crossdomain(origin='*')
  def total_events_monthly(user, repo):
      index = index_name(user, repo)
      data = queries.past_n_months(index, queries.total_events, 6)
      return jsonify(data=data)
  
  @app.route('/<user>/<repo>/most_active_issues')
  @crossdomain(origin='*')
  def most_active_issues(user, repo):
      index = index_name(user, repo)
      data = queries.most_active_issues(index)
      return jsonify(data=data)
  
  @app.route('/<user>/<repo>/open_issues')
  @crossdomain(origin='*')
  def open_issues(user, repo):
      index = index_name(user, repo)
      data = queries.open_issues(index)
      return jsonify(data=data)
  
  @app.route('/<user>/<repo>/issues_without_comments')
  @crossdomain(origin='*')
  def issues_without_comments(user, repo):
      index = index_name(user, repo)
      data = queries.issues_without_comments(index)
      return jsonify(data=data)
  
  @app.route('/<user>/<repo>/<login>/issues_assigned')
  @crossdomain(origin='*')
  def issues_assigned_to(user, repo, login):
      index = index_name(user, repo)
      data = queries.issues_assigned_to(index, login)
      return jsonify(data=data)
  
  if __name__ == '__main__':
      app.run(host='0.0.0.0')
  
  
new_contents: import queries
  
  from utils import crossdomain
  from flask import Flask, jsonify
  
  app = Flask(__name__)
  app.debug = True
  
  def index_name(user, repo):
      return '-'.join((user, repo))
  
  
  # api endpoints that call the queries
  
  @app.route('/<user>/<repo>/most_active_people')
  @crossdomain(origin='*')
  def most_active_people(user, repo):
      index = index_name(user, repo)
      data = queries.most_active_people(index)
      return jsonify(data=data)
  
  @app.route('/<user>/<repo>/total_events_monthly')
  @crossdomain(origin='*')
  def total_events_monthly(user, repo):
      index = index_name(user, repo)
      data = queries.past_n_months(index, queries.total_events, 6)
      return jsonify(data=data)
  
  @app.route('/<user>/<repo>/most_active_issues')
  @crossdomain(origin='*')
  def most_active_issues(user, repo):
      index = index_name(user, repo)
      data = queries.most_active_issues(index)
      return jsonify(data=data)
  
  @app.route('/<user>/<repo>/open_issues')
  @crossdomain(origin='*')
  def open_issues(user, repo):
      index = index_name(user, repo)
      data = queries.open_issues(index)
      return jsonify(data=data)
  
  @app.route('/<user>/<repo>/issues_without_comments')
  @crossdomain(origin='*')
  def issues_without_comments(user, repo):
      index = index_name(user, repo)
      data = queries.issues_without_comments(index)
      return jsonify(data=data)
  
  @app.route('/<owner>/<repo>/<login>/issues_assigned')
  @crossdomain(origin='*')
  def issues_assigned_to(owner, repo, login):
      index = index_name(owner, repo)
      data = queries.issues_assigned_to(index, login)
      return jsonify(data=data)
  
  if __name__ == '__main__':
      app.run(host='0.0.0.0')
  
  
subject: Rename api call