added method for loading the api