Fixed create_sample and added add_sample to userapi