Moved service wrapper code to ApiHandler