Add retrieveing topic impl, fix bugs