Groupon nearly in the black as it cuts losses by 96%