Close resources when making requests