Catch HttpError or other exceptions in api server
and generate HTTP 400 with the correct error message

Change-Id: Ied4c6c263bd0a8c2fdacb6f53a2f72363ce19698