api: implemented healthcheck.

closes #563.