They both did it, but James was so shocked from killing his girlfriend that he got amnesia and forgot the whole thing. He even forgot he had a girlfriend, which is why it took him so long to figure out that he one and that she was missing. The friend was happy when James got amnesia (now no one could rat him out), but when James partially recovered and called his friend, the friend began to panic. So when they got to the house James went in first and the friend suspiciously 'just waited' by the door. He was really moving the body to a safer location, when he got uninterrupted by James returning. He promptly dropped the body and returned to his waiting spot to not arouse suspicion, and James tripped over the moved body still not having remembered the killing. Also, James had a cold and couldn't smell the decayed body, but his friend knew what to expect so he wasn't surprised by the smell. Case solved