Return a 400 response on pymongo DuplicateKeyError

Duplicate key errors were returning 500s. Now they return a more precise 400 instead (409 would be the most accurate, but I see you're reraising errors as 400s - search for "# consider all other exceptions as Bad Requests". Perhaps this is to avoid leaking too much information?)