creating a custom service or factory
using promises