Pushed init function to middleware instead of the router

make sure everything still works.

builds off https://github.com/johnhof/IceBuddy/pull/6