input: def user_api() -> Flask:
      """ Implement a REST API in Python for creating and reading users. The API should have endpoints for creating a user, reading all users, and reading a single user.
  
      Example usage:
      POST /users with body {"name": "John", "email": "john@example.com"} should create a new user and return {"message": "User created"}.
      GET /users should return a JSON array of all users.
      GET /users/1 should return the details of the user with id 1.
      """
output:     
      app = Flask(__name__)
      users = []
      user_id_counter = 1
  
      @app.route('/users', methods=['POST'])
      def create_user():
          global user_id_counter
          data = request.get_json()
          user = {
              'id': user_id_counter,
              'name': data['name'],
              'email': data['email']
          }
          users.append(user)
          user_id_counter += 1
          return jsonify({"message": "User created"}), 201
  
      @app.route('/users', methods=['GET'])
      def get_all_users():
          return jsonify(users)
  
      @app.route('/users/<int:user_id>', methods=['GET'])
      def get_user(user_id):
          for user in users:
              if user['id'] == user_id:
                  return jsonify(user)
          return jsonify({"message": "User not found"}), 404
  
      return app
  