Adding logging and tests to the sample API