refactoring securepass_api_ping