Database API for fetching locations