Handler refactor to APIHandler and SyncHandler.