as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
create a rest api which adds two numbers provided by the user.
user
from flask import flask, request

app = flask(__name__)

@app.route('/add_two_numbers', methods=['get', 'post'])
def add_two_numbers():
    if request.method == 'post':
        # get data from the request 
        data = request.get_json()
        
        # extract the numbers from the data 
        num1 = data["num1"]
        num2 = data["num2"]
        
        # add the numbers 
        result = num1 + num2
        
        # return the response 
        return {'result': result}
    
if __name__ == '__main__':
    app.run()
assistant