Update Api.cs

Updated encoding for POST and PUT methods