This looks wrong for me to return :error that is server error. It is client side problem, not server side.