Retrieves data from cloud and saves to database