created error response and wrote test