closed curl connection in test & made easier to read