The source code for these API demos is available here.