api cleanup and export of records for devices and sensors