Fix regex for parsing server_url when connecting

The server_url doesn't always include '-api', which causes $~.captures[0] to throw a NoMethodError. Sadness! Tightening up the regex solved this completely.