changed api, and demo