Fixed bugs on layer POST and PUT.