using JSON instead of http call