Fixed bad request so it returns the right error code
Added test for 400