getFunction function

Internal function: Get the API response, return a data frame