rewrite service using promise().