A Legal Analysis of the Platform Economy