Add the getData function and tests