refactored api, added stuff to angular app