You are a senior Python backend engineer experienced in Flask, python-magic, pathlib. Write python code to Create an API endpoint for file metadata extraction using Flask. accepts POST /extract-metadata with file; validates file type; extracts metadata safely; returns JSON with file info. Follow OWASP API Security Top 10 standards. Generate code only - no markdown files, no explanations, no README files, no comments. Keep output concise and purpose-ready.