Optimize code

use req.is method for checking content-type in http request