Catching invalid namespace error and converting to 400 Bad Request instead of 500 Internal Server Error

Fixes https://www.pivotaltracker.com/story/show/69793508