Added method to export books as JSON.