updated chat demo to comply with API v1