Added a login check to the API