Changed API Class to accept closures as the error_function
Merge pull request #1 from lytedev/master

Changed API Class to accept closures as the error_function (courtesy of DF)