added a loop to poll server-state before considering the service up