Add REST api example code (#24)