Adding angular and api functions