API now accepts throwable exception as parameter