API: impl. and tests custom urls and redirection wrt media_resources

Squashed commit of the following:

commit 6a63242d113da74c91c25d15793539cc2c757caa
Author: Thomas Schank <DrTom@schank.ch>
Date:   Tue Mar 25 17:14:56 2014 +0100

    Test and minor fix

commit e346ce1a35c604638ece0f6b2e3da006bed3ca47
Author: Thomas Schank <DrTom@schank.ch>
Date:   Tue Mar 25 16:24:37 2014 +0100

    tests ...

commit 400ee5dc0cb1a4a8fb364030461d657fe31430f2
Author: Thomas Schank <DrTom@schank.ch>
Date:   Tue Mar 25 15:20:19 2014 +0100

    ...

commit 6b54f0f9194e6d62f91c8019bc48ae0cf12518fa
Author: Thomas Schank <DrTom@schank.ch>
Date:   Tue Mar 25 14:49:39 2014 +0100

    API: Hanling custom urls and general redirect issues