add rest api for records.