Add tests for new account API function