adding basic auth and making json calls relative