push and pop functions into json object