Modified demo to use REST API, refactored, added document, and so on