1. check media type; 2. add mocha tests