Add api query handlers.