Fix list_projects_for_endpoint failed bug

list_projects_for_endpoint fails with "500 Internal Server Error".
Modified the function name to 'list_projects_for_endpoint' and
added three test cases.

Change-Id: Ibe86dd4fb845004d4ebce359de034f31bd50ecc9
Closes-Bug: #1269703
(cherry picked from commit 2f7fa55bd046b5e0ec7b7c2bad8c88c7f33d0c9e)
Merge "Fix list_projects_for_endpoint failed bug" into stable/havana