Started the first few methods to intigrate the api to the database.

- untested.