Modified to encode the respone['location']