Added error handling to server for unauthorized requests.
Added logic to AuthenticationRoute.