Started writing the database API Layer