Using API collect data from database and autofill the form