Api program part 2

part 2 of my api program, takes values from api and inserts into
database.