Start the session on rest.php, so it avoids impossible to find side effects. Trust me, I lost hours on that one: civi needs a session.
Merge pull request #1245 from tttp/crm-13091

Start the session on rest.php