Functions moved to controller.
Remove ajax-page. Use EID.
Use jQuery for generate auth URL.