added generic update middleware
refactored update middleware with promise
Merge pull request #6 from lemonde/update-middleware

added generic update middleware