Change js object type to be usable as an angular service