input: Write a function to implement a basic REST API with authentication and endpoints in Python using Flask and Flask-RESTful. The API should include JWT authentication, a resource called 'Item' with GET and POST methods, and a resource called 'ItemList' with a GET method. The GET method for 'Item' should require JWT authentication. The POST method for 'Item' should create a new item in a list and return the created item with a status code of 201.
  assert api_implementation()=={'items': []}
  assert api_implementation().get("/item/phone")=={'item': {'name': 'phone', 'price': 12.00}}
  assert api_implementation().post("/item/laptop")=={'name': 'laptop', 'price': 12.00}
  assert api_implementation().get("/items")=={'items': [{'name': 'phone', 'price': 12.00}, {'name': 'laptop', 'price': 12.00}]}
output: 
  from flask import Flask, request, jsonify
  from flask_restful import Api, Resource
  from flask_jwt_extended import JWTManager, jwt_required, create_access_token
  
  app = Flask(__name__)
  api = Api(app)
  app.config['JWT_SECRET_KEY'] = 'super-secret'
  jwt = JWTManager(app)
  
  items = []
  
  class Item(Resource):
      @jwt_required()
      def get(self, name):
          item = next(filter(lambda x: x['name'] == name, items), None)
          return {'item': item}, 200 if item else 404
  
      def post(self, name):
          if next(filter(lambda x: x['name'] == name, items), None):
              return {'message': "An item with name '{}' already exists.".format(name)}, 400
          data = request.get_json()
          item = {'name': name, 'price': data['price']}
          items.append(item)
          return item, 201
  
  class ItemList(Resource):
      def get(self):
          return {'items': items}, 200
  
  api.add_resource(Item, '/item/<string:name>')
  api.add_resource(ItemList, '/items')
  
  def api_implementation():
      return app
  