in the crime novels , a pi is either an ex-cop or has some cop buddies who owed him a favor and who happily provided him with the department 's files , while carrying on about how it could cost them their job .