input: Write a function to create a Flask API that fetches data from a SQLite database and returns the data in JSON format. The function should include a route that retrieves all records from a table named "users." If the function is executed in the main module, it should start the Flask development server with debug mode enabled.
  assert create_api() is not None
output: 
  from flask import Flask, jsonify
  import sqlite3
  
  def create_api():
      app = Flask(__name__)
  
      @app.route('/users', methods=['GET'])
      def get_users():
          conn = sqlite3.connect('database.db')
          cursor = conn.cursor()
          cursor.execute("SELECT * FROM users")
          rows = cursor.fetchall()
          conn.close()
          return jsonify(rows)
  
      if __name__ == '__main__':
          app.run(debug=True)
  
      return app
  