Fix some issues and implement getDatasources