Updated stuff and added origin check since we have a different virtualhost for the api