save and read key-values on file