Makeapi service and directives for angular