a less messed up way to render json
nested view stuff worked out