Modified api.rb