apply middleware to post, put, delete