input: Write a function to create a basic REST API using Flask that includes JWT authentication. The API should have endpoints for retrieving and adding items. If the given item is found, return the item; otherwise, return a 404 error. If an item is added successfully, return the item with a status code of 201. If the item list is retrieved successfully, return a dictionary containing all items.
  
  if name == 'main':
   app.run(port=5000, debug=True)
  
  assert create_api().retrieve_item('item1')=={'item': None}, 404
  assert create_api().add_item('item1')=={'name': 'item1', 'price': 12.00}, 201
  assert create_api().retrieve_item('item1')=={'name': 'item1', 'price': 12.00}
  assert create_api().retrieve_item_list()=={'items': [{'name': 'item1', 'price': 12.00}]}
output: 
  def create_api():
      from flask import Flask, jsonify, request
      from flask_jwt_extended import JWTManager, jwt_required, create_access_token
  
      app = Flask(__name__)
      app.config['JWT_SECRET_KEY'] = 'super-secret'
      jwt = JWTManager(app)
  
      items = {}
  
      @app.route('/login', methods=['POST'])
      def login():
          username = request.json.get('username', None)
          password = request.json.get('password', None)
          if username != 'test' or password != 'test':
              return jsonify({"msg": "Bad username or password"}), 401
  
          access_token = create_access_token(identity=username)
          return jsonify(access_token=access_token)
  
      @app.route('/item/<string:name>', methods=['GET'])
      @jwt_required()
      def retrieve_item(name):
          item = items.get(name)
          if item is None:
              return jsonify({'item': None}), 404
          return jsonify(item)
  
      @app.route('/item', methods=['POST'])
      @jwt_required()
      def add_item():
          name = request.json.get('name', None)
          price = request.json.get('price', None)
          if name is None or price is None:
              return jsonify({"msg": "Missing name or price"}), 400
          items[name] = {'name': name, 'price': price}
          return jsonify(items[name]), 201
  
      @app.route('/items', methods=['GET'])
      @jwt_required()
      def retrieve_item_list():
          return jsonify({'items': list(items.values())})
  
      return app
  