refactored after merging the ruby api client changes