added method to call the api