Shouldn't this be "nilikuwa katika..." this sentence basically sounded to me like "when i was American, i had a car". I guess if it was "... was in a market", you could modify the noun -soko- to -sokoni- but here, "marekani" already has a -ni- at the end. Or is saying the usa actually just -mareka- and the -ni- is this locative modification?
"The USA" is Marekani. Proper nouns never take the -ni suffix, even when being used as a locative. Also, when a locative is expected and there is no -ni in sight, there is a good chance that the proper noun is your locative, like in this sentence.