API interaction and Directive fixes