save rest data in userdefaults for offline usage