Various Api related fixes