API: Hanling custom urls and general redirect issues
...
tests ...
Test and minor fix