added more database and api control