Fixed api.pl a bit (registration + deconnected sub DISCONNECT from SIG __WARN__).
Done core API (validation, request, token handling).
TODO:
- automatic token renewal (one per hour)
- user-friendly api requests (notes.fetch, notes.remove etc.)