input: def fetch_data_from_sql_to_json()-> str:
      """
      Develop 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', execute a query to fetch all data from the 'users' table,
      and return the data formatted as JSON.
      Example:
      Suppose the 'users' table has the following data:
      | id | name  | email          |
      |----|-------|----------------|
      | 1  | Alice | alice@mail.com |
      | 2  | Bob   | bob@mail.com   |
      | 3  | Carol | carol@mail.com |
  
      The API should return a JSON response like:
      [
          {'id': 1, 'name': 'Alice', 'email': 'alice@mail.com'},
          {'id': 2, 'name': 'Bob', 'email': 'bob@mail.com'},
          {'id': 3, 'name': 'Carol', 'email': 'carol@mail.com'}
      ]
      Note: Ensure that the returned JSON is formatted as shown.
      """
output:     
      import sqlite3
      import json
  
      conn = sqlite3.connect('database.db')
      cursor = conn.cursor()
      cursor.execute("SELECT * FROM users")
      rows = cursor.fetchall()
      conn.close()
  
      columns = [description[0] for description in cursor.description]
      data = [dict(zip(columns, row)) for row in rows]
  
      return json.dumps(data, indent=4)
  