$resolve service (tested) and integration into $state (only partially tested)