input: Write a function to create a web API using Flask in Python that returns the current date and time when accessed at the endpoint '/datetime'. If the function is executed, it should run the Flask server.
  assert create_datetime_api().route('/datetime')()=='2023-10-05 14:30:45'
  assert create_datetime_api().route('/datetime')()!='2022-01-01 00:00:00'
  assert create_datetime_api() is None
output: 
  from flask import Flask
  from datetime import datetime
  
  def create_datetime_api():
      app = Flask(__name__)
  
      @app.route('/datetime')
      def get_datetime():
          return datetime.now().strftime('%Y-%m-%d %H:%M:%S')
  
      if __name__ == '__main__':
          app.run()
  