Implemented download to CSV functionality.