Fixed empty request body error. Added MIME type detection.

Bugfixes & minor refactoring and string wording.