adapt the sample for topia's api