Can I get the server name I am hooked up to using an API call or is ther another method of doing it ?

Thanks in advance.