Api cache cant write to a file