middleware PUT and POST routes