Updated Bottle script for SAM