implement basic auth for all json requests
fix merge conflicts