Added code to allow the API auth to be turned off.