Making mode configurable

The mode is no longer hard coded to http