Getting response and saving to file