Fix api calls in ruby 1.9