       hasProducts
       setFromBuy
       empty: emptyBasketAndRemoveBuyer
-      products: resolveProducts
-      buyer: resolveBuyer
+      products: -> products
+      buyer: -> buyer
     }
 ])
angular.module('kassa').service('BasketService', [
  '$http'
  '$location'
  'UserService'
  'ProductService'
  ($http, $location, User, Product)->
    products = []
    buyer = null


        #always return the current promise if resolving to prevent multiple requests being run for the same resource
        return buyer if buyer?.then?
        buyer = User.find(username).then (user)-> buyer = user
      else
        buyer = undefined

    updateStateFromSearch = ->
      resolveProducts()
      resolveBuyer()

    $rootScope.$on '$routeUpdate', updateStateFromSearch
    updateStateFromSearch()

    #return api-object with methods/objects accessible from outside
    {
