changed error return code to 400 - Bad request