Fixed localhost server issues and commuted getLocation with getPosition