Helper function to mock responses