it is much simpler now and works with put and post requests