add status code option to generic json handler