In 1917 , the US purchased the Danish portion , which had been in economic decline since the abolition of slavery in 1848 .