added middleware as a package
added analytics access