Started working on api connection.

Contains a todo.