Added subscribe, login and api function