cleaning up the code
now we can override being logged in with an api key