changed the db by using api service