fixed the basic auth header, fixed some Swift related bugs (my fault) by using conditional binding