input: Write a function to create a web API with Python and Flask that returns the current date and time. The function should define a route '/datetime' which responds with the current date and time formatted as "YYYY-MM-DD HH:MM:SS". If the Flask app is run, it should start a server that listens for requests.
  
  from flask import Flask
  import datetime
  
  app = Flask(__name__)
  
  @app.route('/datetime')
  def get_datetime():
      return datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
  
  if __name__ == '__main__':
      app.run()
output: 
  @app.route('/datetime')
  def get_datetime():
      return datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
  