Fixed compile errors
Removed all but one main(). Moved declaration of api_server to seperate header file."
Merge branch 'master' into rpc-server
Merge branch 'master' into rpc-server
Merge remote-tracking branch 'origin/rpc-server'