create parse() function
refactored parse() function
added body-parser to access request json payload