Cleanup dependencies and initialization
Fixed indentation and used repeatedly instead of for
Order of middleware is important
Added middleware to set correct mime-/content-type