input: def fetch_data_from_sql_to_json() -> Flask:
      """Develops an API in Python that fetches data from an SQL database and presents the data in the form of a JSON.
      The API should connect to a SQLite database named 'database.db', fetch all records from the 'users' table, 
      and return them as a JSON response.
      Example:
      >>> fetch_data_from_sql_to_json()
      Running the application will set up a Flask server on http://127.0.0.1:5000/
      When accessing the '/' route, it will return a JSON response containing all user data from the 'users' table.
      """
output:     
      from flask import Flask, jsonify
      import sqlite3
  
      app = Flask(__name__)
  
      def get_db_connection():
          conn = sqlite3.connect('database.db')
          conn.row_factory = sqlite3.Row
          return conn
  
      @app.route('/')
      def index():
          conn = get_db_connection()
          users = conn.execute('SELECT * FROM users').fetchall()
          conn.close()
          return jsonify([dict(user) for user in users])
  
      if __name__ == '__main__':
          app.run(debug=True)
      return app
  