States have legal obligations to prevent and alleviate climate change, says UN