service: fix return values of functions to 0 or 1