Now checks for null in api key cookie