building factory + sql / API get