Somali pirates hijacked more than 40 ships in 2008 , sometimes getting millions of dollars in ransom for their release .