Change all calls to api to use train codes