added alert of error if no fail function provided
auto redirect to login page when api returns 403