input: Write a function to create a Flask API that connects to an SQL database, retrieves data from the users table, and returns the data in JSON format.
  assert index()=='json'
  assert __name__=='main'
  assert app.run(debug = True)=='Running Flask API'
  assert all_users=='json'
  assert sqlite3.connect('database.db')=='connection'
  assert connection.row_factory=='dict_factory'
  assert cur.execute('SELECT * FROM users;')=='query'
  assert jsonify(all_users)=='json'
output: 
  def index():
      import sqlite3
      from flask import Flask, jsonify
  
      app = Flask(__name__)
  
      def dict_factory(cursor, row):
          d = {}
          for idx, col in enumerate(cursor.description):
              d[col[0]] = row[idx]
          return d
  
      @app.route('/')
      def all_users():
          connection = sqlite3.connect('database.db')
          connection.row_factory = dict_factory
          cur = connection.cursor()
          cur.execute('SELECT * FROM users;')
          all_users = cur.fetchall()
          connection.close()
          return jsonify(all_users)
  
      if __name__ == '__main__':
          app.run(debug=True)
  