Add an exception to throw for incorrect API usage