when did california officially become a part of the usa