Wall Street ends week higher but posts monthly loss