Allow passing a custom protocol.

This allows swagger definitions to work properly when the API is behind
an SSL terminator.
Remove hidden properties from definition.