API changes

added insert db call and /api call