Made permission changes and refactorings on web files
Fixed header sending on file download
Actually fixed late header sending in PHP file now