fixed a bug in api PUT commands