Example code from "API-ify Your Web Apps" talk at Boise Code Camp 2014