Manchester City boss Pep Guardiola admits his side were far from their best but ground out an important victory at Crystal Palace.