sync with 0.9.9 ruby fork changes in client.rb, fix a missing case in api.rb