Add API endpoint for document validation