form and read the api query as json