added 201 to valid status codes in handle exception