getting json output using api