Refactoring of API. Added locate API.