changes to api and save csv