Added same functionality as node server