Location API endpoint which also handles validation