Make endpoints return 400 instead of 500

@erictune 
Fixes https://github.com/GoogleCloudPlatform/kubernetes/issues/2113
Test case (maybe using IsBadRequest) to verify the whole flow works.