Changed backend to respond with lengths

Urls to script are only resolved on backend, so frontend was unable to properly
calculate those.