add some logic to the restApi to handle the authentication