handling put and delete requests