http handler should return error to client