added optional success and fail callbacks for login