Use API key for AJAX request for non-public projects

This requires that REST webservice authentication is
enabled:
  Administration -> Settings -> Authentication

Signed-off-by: Tobias Droste <tdroste@gmx.de>