Made database and push service params configurable through ini file

Moved all setup logic to Api class.
Added exception handling during Api class setup process.
Added exception handling to heartbeat API method.