call api server and switched email form to ajax request.