Fix bug related to access permissions to the end points
Created by: hamzaremmal
fix an issue related to the end point accessibility.
When accessing an end point that is permitted. The web service crashes and doesn't allow access. this PR fixes this issue.