main api, single handler