Stopped hard coding URL in JS