An out of sorts Roger Federer lost to Kei Nishikori at the ATP Finals at the O2 Arena in London.