Move accepts header to middleware; add models and middleware