fixed bug where empty json returned