Added Write API Media test & various fixes
Merge pull request #333 from Bladrak/apiWriteMedia

Added Write API Media test & various fixes