Fixed crash when specifying a client in the query; Removed some extraneous code; Return http status code when server connection test fails.