Added api hook + Javascript function to get data