update locations schema
refactored code. moved api to separate repo