prototype for put and post handler