Small modifications to demo of API and some fixes