changed service functions to return an error