almost done in returning JSON