building JSON to fit models