Renamed toUnderscore -> toAPI, corrected behavior