Add all rpc methods needed and some bugfixes