Fix to remove a warning.
Converting to modern objective-c syntax.
Fixing the main causes of 401 errors.

This was due to trying to log twice at login and trying to refresh the user token when no previous token has been arleady set.
Adding the version info in the headers of every request.