Creates a failure response with the given exception.
Creates a successful response with the given data.