Fix errors for create_endpoint api in version2

1. Create an endpoint without 'service_id' should return a 400 Bad Request
with appropriate message instead of 500 Internal Server Error.
2. Empty urls should be discarded.

Change-Id: I535467ec35fe2ae738ecae0a4f20d19ff4f001ec
Closes-Bug: #1250765