Locate and Replace resources:
Find the line starting with resources = { and replace it and its contents with the new block above.
Replace get_resource:
Find the existing @app.route("/resources/<resource_id>", methods=["GET"]) function and replace the entire function (from @app.route to its last return) with the new get_resource block.
Add update_resource:
Insert the new update_resource function right after the get_resource function ends. Ensure it’s before the next endpoint (likely /pay).