api service endpoints interacting properly with angular