Moved ApiMiddleware into common lib
Continuing to debug CSRF on pagodabox