fix api to create database