input: Write a function to create a basic REST API with authentication and endpoints in Python using Flask and Flask-RESTful. The API should support JWT authentication and have endpoints for retrieving and adding items. If the item is not found during retrieval, it should return a 404 status code. If the given input is not applicable then return None.
  assert create_rest_api()!=None
  assert create_rest_api().secret_key=='super-secret-key'
  assert create_rest_api().url_map.endpoints=={'item', 'items'}
  assert create_rest_api().config['JSONIFY_PRETTYPRINT_REGULAR']==False
  assert create_rest_api()!=None
output: 
  def create_rest_api():
      from flask import Flask, jsonify, request
      from flask_restful import Api, Resource
      from flask_jwt_extended import JWTManager, jwt_required, create_access_token
  
      app = Flask(__name__)
      app.secret_key = 'super-secret-key'
      app.config['JSONIFY_PRETTYPRINT_REGULAR'] = False
      api = Api(app)
      jwt = JWTManager(app)
  
      items = []
  
      class Item(Resource):
          @jwt_required()
          def get(self, name):
              item = next((i for i in items if i['name'] == name), None)
              if item:
                  return jsonify(item)
              return '', 404
  
          @jwt_required()
          def post(self, name):
              new_item = {'name': name, 'value': request.json['value']}
              items.append(new_item)
              return jsonify(new_item), 201
  
      api.add_resource(Item, '/item/<string:name>')
      api.add_resource(Item, '/items')
  
      return app
  