collaspe almost the same put and post method in api-client.h