got everything working and return json objects