Throw proper error codes when creating invalid folders through the API, fix #297