Put API debug in the correct file.
Better handling of proxy requests errors.