Path generation fixes

Fixes a bug introduced by me with #22 where no params would result in an error, sorry for that. Plus I refactored ``get_api_path``. The refactoring eliminates the bug referenced in #26 which itself is **not** a result of #22.

On a side note, I think it would be a good idea to extend and overhaul the test suite. It's very rigid at the moment and doesn't cover all test cases. An extensive test suite would provide a good fundament to refactor the code and make additions easier.

Cheers