now pulls from server and writes locally in case of no internet