Build service object with a string

Using a code object makes it non-pickeable, so use the content instead.
Fix url of created service
Fix forgotten import
PEP 8