some abstractions for api handlers