input: 
  def fetch_users_data() -> str:
      """
      Develops a Python API that fetches data from an SQL database (sqlite3) and presents the data in the form of a JSON using Flask.
      Returns the JSON formatted string of all users fetched from the 'users' table in the database.
      
      >>> fetch_users_data()
      '[{"id": 1, "name": "Alice", "age": 30}, {"id": 2, "name": "Bob", "age": 25}]'
      >>> fetch_users_data()
      '[{"id": 3, "name": "Charlie", "age": 35}, {"id": 4, "name": "Diana", "age": 40}]'
      """
      import json 
      import sqlite3
      from flask import Flask, request, 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('/', methods=['GET'])
      def index(): 
          connection = sqlite3.connect('database.db')
          connection.row_factory = dict_factory
          cur = connection.cursor() 
          all_users = cur.execute('SELECT * FROM users;').fetchall() 
          return jsonify(all_users) 
        
      if __name__ == '__main__': 
          app.run(debug = True)
  
output:     with app.test_client() as client:
          response = client.get('/')
          return response.get_data(as_text=True)