added functions to pull and insert locations data from api