cuba continued to be a spanish colony until the spanish american war