why was the transcontinental railroad built