load data function for router