Fix malformed API query - issue #5