autopopulate function/api added