added model, mongoose and middleware