redo changes to api.rb that were missed somehow in the merge